/* ============================================================================
 * sf-admin.css — Skillfull design system
 *
 * The single source of truth for the look of every admin-grade page in the
 * app: /admin/* (Tenant area), /profile/* (learner area), Operations, and
 * the public profile page. Loaded from each area's _layout.cshtml.
 *
 * The project was scaffolded on the Phoenix Bootstrap theme and is slowly
 * replacing Phoenix classes with sf-* primitives. Bootstrap utilities are
 * still in play (text-truncate, table-responsive, grid columns, badges);
 * Phoenix-specific things (.btn-phoenix-secondary, .text-body-tertiary)
 * are honoured but we don't add new dependencies on them.
 *
 * Section index:
 *   1. Containers          — page-level max-widths
 *   2. Hero bands          — top of every admin page
 *   3. Cards               — sf-card, sf-stat, sf-kpi, sf-integration
 *   4. Tiles               — sf-shortcut, sf-action (clickable cards)
 *   5. Components          — avatars, icon circles, line-clamp, etc.
 *   6. Calendar            — sf-cal-* monthly grid
 *   7. Upload drop zone    — branding image picker
 *   8. Reports event rows  — sf-ev-*
 *   9. Status rings        — ring-warning / ring-danger
 *  10. Gradient palette    — sf-grad-* (used on icon circles)
 *  11. Design tokens       — :root --sf-* shared design tokens
 *  12. Pills + status      — sf-pill, sf-status-pill
 *  13. Admin tables        — sf-table list table
 *  14. List page toolbar   — sf-list-toolbar
 *  15. Square avatar       — sf-avatar-square (non-circular variant)
 *  16. System dashboard    — sf-pulse-hero, sf-mini-card, sf-activity-row, sf-nav-strip
 *  17. Quick search        — sf-qsearch-* (Ctrl/Cmd+K overlay across Operations)
 * ========================================================================= */


/* ---------- 11. Design tokens ----------------------------------------------
 * Shared --sf-* tokens consumable by inline <style> blocks. Promoted from
 * Areas/Curator/Projects/Views/Enroll.cshtml which was the only file
 * defining them. Add new tokens here, not in per-page <style> blocks.
 */
:root {
    --sf-ink:     #0f172a;
    --sf-muted:   #64748b;
    --sf-bg:      #f6f8fb;
    --sf-card:    #ffffff;
    --sf-blue:    #2563eb;
    --sf-border:  rgba(15,23,42,.10);
    --sf-border2: rgba(15,23,42,.07);
    --sf-shadow:  0 10px 26px rgba(24,36,64,.08);
    --sf-shadow2: 0 6px 18px rgba(24,36,64,.06);
}
[data-bs-theme="dark"] {
    --sf-ink:     #e2e8f0;
    --sf-muted:   #94a3b8;
    --sf-bg:      #0f172a;
    --sf-card:    rgba(17,24,39,.55);
    --sf-border:  rgba(255,255,255,.10);
    --sf-border2: rgba(255,255,255,.07);
    --sf-shadow:  0 10px 26px rgba(0,0,0,.30);
    --sf-shadow2: 0 6px 18px rgba(0,0,0,.22);
}


/* ---------- 12. Pills + status ---------------------------------------------
 * Subtle-tinted pills for inline status / tag display. sf-pill is the
 * generic shape; sf-pill-{tone} sets the color. sf-status-pill adds a
 * leading 6px dot for live-state indicators.
 */
.sf-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.45;
    border-radius: 999px;
    background: rgba(15,23,42,.06);
    color: rgba(15,23,42,.78);
    white-space: nowrap;
}
.sf-pill-success { background: rgba(22,163,74,.12);  color: #166534; }
.sf-pill-warning { background: rgba(245,158,11,.14); color: #92400e; }
.sf-pill-danger  { background: rgba(239,68,68,.12);  color: #991b1b; }
.sf-pill-info    { background: rgba(37,99,235,.10);  color: #1d4ed8; }
.sf-pill-neutral { background: rgba(100,116,139,.14); color: #334155; }
[data-bs-theme="dark"] .sf-pill         { background: rgba(255,255,255,.08); color: rgba(255,255,255,.78); }
[data-bs-theme="dark"] .sf-pill-success { background: rgba(34,197,94,.18);  color: #86efac; }
[data-bs-theme="dark"] .sf-pill-warning { background: rgba(245,158,11,.22); color: #fcd34d; }
[data-bs-theme="dark"] .sf-pill-danger  { background: rgba(248,113,113,.20); color: #fca5a5; }
[data-bs-theme="dark"] .sf-pill-info    { background: rgba(96,165,250,.18); color: #93c5fd; }
[data-bs-theme="dark"] .sf-pill-neutral { background: rgba(148,163,184,.20); color: #cbd5e1; }

.sf-status-pill { position: relative; padding-left: 18px; }
.sf-status-pill::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    transform: translateY(-50%);
}


/* ---------- 13. Admin tables -----------------------------------------------
 * Clean list-table styling shared by admin pages with sortable / paginated
 * rows. Apply to <table class="sf-table"> directly.
 */
.sf-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--sf-card);
    border-radius: 12px;
    overflow: hidden;
}
.sf-table thead th {
    background: rgba(15,23,42,.04);
    color: var(--sf-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--sf-border);
    text-align: left;
}
.sf-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--sf-border2);
    color: var(--sf-ink);
    font-size: .9rem;
    vertical-align: middle;
}
.sf-table tbody tr:hover td { background: rgba(37,99,235,.04); }
.sf-table tbody tr:last-child td { border-bottom: 0; }
[data-bs-theme="dark"] .sf-table thead th { background: rgba(255,255,255,.04); }
[data-bs-theme="dark"] .sf-table tbody tr:hover td { background: rgba(96,165,250,.06); }


/* ---------- 14. List page toolbar ------------------------------------------
 * Standard search + filter / tab strip above an admin list table.
 * Container handles wrap on narrow screens.
 */
.sf-list-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}
.sf-list-toolbar .sf-list-search {
    position: relative;
    flex: 1 1 240px;
    max-width: 360px;
}
.sf-list-toolbar .sf-list-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border-radius: 10px;
    border: 1px solid var(--sf-border);
    background: var(--sf-card);
    font-size: .9rem;
}
.sf-list-toolbar .sf-list-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sf-muted);
    font-size: .85rem;
}
.sf-list-toolbar .sf-list-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(15,23,42,.04);
    border-radius: 10px;
}
.sf-list-toolbar .sf-list-tab {
    padding: 6px 12px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--sf-muted);
    border-radius: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.sf-list-toolbar .sf-list-tab.active {
    background: var(--sf-card);
    color: var(--sf-ink);
    box-shadow: var(--sf-shadow2);
}


/* ---------- 15. Square avatar ----------------------------------------------
 * Non-circular avatar variant for places that show a logo / org thumbnail
 * (tenant cards) rather than a person headshot. Pair with size modifiers
 * (sf-avatar-sm/-lg) from section 5.
 */
.sf-avatar-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(15,23,42,.06);
    color: var(--sf-ink);
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}
.sf-avatar-square img { width: 100%; height: 100%; object-fit: cover; }
.sf-avatar-square.sf-avatar-sm { width: 32px; height: 32px; font-size: .8rem; border-radius: 8px; }
.sf-avatar-square.sf-avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; border-radius: 12px; }


/* ---------- 1. Containers ---------------------------------------------------
 * Use on the outermost <div class="container py-4 sf-container-…"> to set
 * the right page width. xl is wide list/dashboard pages, sm is narrow forms.
 */
.sf-container-xl { max-width: 1240px; }
.sf-container-lg { max-width: 1100px; }
.sf-container-md { max-width: 960px;  }
.sf-container-sm { max-width: 760px;  }
.sf-container-xs { max-width: 540px;  }


/* ---------- 2. Hero bands --------------------------------------------------- */
.sf-admin-hero {
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(44,123,229,.10), rgba(126,75,255,.08));
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 12px 40px rgba(15,23,42,.08);
}
.sf-admin-hero h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.sf-admin-hero .sub { color: rgba(0,0,0,.55); margin-top: 6px; }
[data-bs-theme="dark"] .sf-admin-hero .sub { color: rgba(255,255,255,.62); }

/* Billing variant — green/blue tint */
.sf-bill-hero {
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(59,130,246,.10));
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 10px 30px rgba(15,23,42,.05);
}
.sf-bill-hero h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.sf-bill-hero .sub { color: rgba(0,0,0,.55); margin-top: 6px; }


/* ---------- 3. Cards ------------------------------------------------------- */
.sf-card {
    background: var(--phoenix-card-bg, #fff);
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15,23,42,.05);
}
[data-bs-theme="dark"] .sf-card { background: rgba(17,24,39,.55); border-color: rgba(255,255,255,.10); }
.sf-card h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px 0; }
.sf-card .meta { color: rgba(0,0,0,.55); font-size: .85rem; }
[data-bs-theme="dark"] .sf-card .meta { color: rgba(255,255,255,.62); }

/* Big stat card (KPI strip). */
.sf-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--phoenix-card-bg, #fff);
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 8px 22px rgba(15,23,42,.05);
    min-height: 92px;
}
[data-bs-theme="dark"] .sf-kpi { background: rgba(17,24,39,.55); border-color: rgba(255,255,255,.10); }
.sf-kpi .icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.sf-kpi .value { font-weight: 800; font-size: 1.55rem; line-height: 1; letter-spacing: -.01em; }
.sf-kpi .label { color: rgba(0,0,0,.6); font-size: .9rem; margin-top: 4px; }
[data-bs-theme="dark"] .sf-kpi .label { color: rgba(255,255,255,.65); }

/* Compact stat — Billing page header row. */
.sf-stat {
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--phoenix-card-bg, #fff);
    border: 1px solid rgba(15,23,42,.08);
}
.sf-stat .label { color: rgba(0,0,0,.55); font-size: .85rem; }
.sf-stat .value { font-weight: 800; font-size: 1.15rem; }
[data-bs-theme="dark"] .sf-stat { background: rgba(17,24,39,.55); border-color: rgba(255,255,255,.10); }
[data-bs-theme="dark"] .sf-stat .label { color: rgba(255,255,255,.62); }

/* Integration card (Integrations page). */
.sf-integration {
    background: var(--phoenix-card-bg, #fff);
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(15,23,42,.05);
    height: 100%;
}
.sf-integration .icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    margin-bottom: 12px;
}
.sf-integration h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.sf-integration .desc { color: rgba(0,0,0,.6); font-size: .9rem; margin-top: 4px; }
[data-bs-theme="dark"] .sf-integration .desc { color: rgba(255,255,255,.65); }


/* ---------- 4. Tiles (clickable cards) ------------------------------------ */
.sf-shortcut,
.sf-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--phoenix-card-bg, #fff);
    border: 1px solid rgba(15,23,42,.08);
    text-decoration: none !important;
    color: inherit;
    transition: transform .12s, box-shadow .12s, border-color .12s;
    /* min-width:0 propagates through the flex chain so .text-truncate inside
       actually clips. Without it, long course titles in the "Required for you"
       and "You might also like" strips overflow the card. */
    min-width: 0;
    overflow: hidden;
}
.sf-shortcut:hover,
.sf-action:hover {
    border-color: rgba(44,92,190,.40);
    box-shadow: 0 12px 24px rgba(44,92,190,.10);
    transform: translateY(-1px);
}
.sf-shortcut > .icon,
.sf-action   > .icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
/* Children of a flex container default to min-content sizing, which defeats
   text-truncate. Force min-width:0 on the text column. */
.sf-shortcut > *:not(.icon),
.sf-action   > *:not(.icon) { min-width: 0; }
.sf-shortcut .title,
.sf-action   .fw-bold { font-weight: 700; }
.sf-shortcut .desc { color: rgba(0,0,0,.55); font-size: .85rem; }
[data-bs-theme="dark"] .sf-shortcut .desc,
[data-bs-theme="dark"] .sf-action .text-body-tertiary { color: rgba(255,255,255,.62); }


/* ---------- 5. Components --------------------------------------------------
 * Reusable primitives that live across many pages.
 */

/* sf-avatar — square aspect-ratio circular crop. The defaults render a 96px
 * disc; modifier classes swap the size. Apply .sf-avatar to an <img> for
 * cover-cropped photos, or to a <div> for initials fallbacks (set bg-* and
 * text-* via Bootstrap, contents are the initials). */
.sf-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.sf-avatar-xl { width: 120px; height: 120px; font-size: 2rem;    }
.sf-avatar-lg { width: 96px;  height: 96px;  font-size: 1.7rem;  }
.sf-avatar-md { width: 64px;  height: 64px;  font-size: 1.4rem;  }
.sf-avatar-sm { width: 44px;  height: 44px;  font-size: 1.1rem;  }
.sf-avatar-xs { width: 32px;  height: 32px;  font-size: .85rem;  }

/* sf-icon-circle — a coloured disc with a centred icon, typically combined
 * with one of the sf-grad-* gradient classes. Used for activity rows,
 * notifications, certificate cards, dashboard recommendations. */
.sf-icon-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sf-icon-circle-sm { width: 32px; height: 32px; font-size: .85rem; }
.sf-icon-circle-md { width: 36px; height: 36px; }
.sf-icon-circle-lg { width: 44px; height: 44px; }

/* sf-clamp-2 — multi-line ellipsis at exactly two lines. text-truncate only
 * handles one line; this handles paragraphs. */
.sf-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* sf-bio — narrow centred paragraph for public-profile bios + similar. */
.sf-bio { max-width: 30rem; }

/* sf-border — neutral translucent divider/border. Replaces Phoenix's
 * `.border-translucent` so views don't depend on Phoenix's stylesheet. */
.sf-border-bottom { border-bottom: 1px solid rgba(15,23,42,.08); }
.sf-border-top    { border-top:    1px solid rgba(15,23,42,.08); }
.sf-border        { border:        1px solid rgba(15,23,42,.08); }
[data-bs-theme="dark"] .sf-border-bottom { border-bottom-color: rgba(255,255,255,.10); }
[data-bs-theme="dark"] .sf-border-top    { border-top-color:    rgba(255,255,255,.10); }
[data-bs-theme="dark"] .sf-border        { border-color:        rgba(255,255,255,.10); }


/* ---------- Buttons --------------------------------------------------------
 * The .sf-btn family. Bootstrap's .btn provides padding/font/transition; we
 * layer colour + a soft hover lift on top so buttons look intentional
 * without depending on the Phoenix theme's btn-phoenix-* overrides.
 *
 * Use as: <button class="btn sf-btn sf-btn-primary">…</button>
 *
 * Variants:
 *   sf-btn-primary    — filled, brand colour (main CTA)
 *   sf-btn-secondary  — outlined neutral (most actions)
 *   sf-btn-danger     — outlined red (destructive)
 *   sf-btn-ghost      — borderless link-style action
 *   sf-btn-icon       — square circular icon button
 *
 * Sizes:
 *   sf-btn-sm / sf-btn-lg — Bootstrap-compatible size overrides
 */
.sf-btn {
    --sf-btn-bg: #fff;
    --sf-btn-fg: #1e293b;
    --sf-btn-border: rgba(15,23,42,.18);
    --sf-btn-hover-bg: rgba(15,23,42,.04);
    --sf-btn-hover-border: rgba(15,23,42,.28);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: var(--sf-btn-bg);
    color: var(--sf-btn-fg);
    border: 1px solid var(--sf-btn-border);
    border-radius: 8px;
    padding: .5rem .9rem;
    font-weight: 600;
    font-size: .875rem;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s, transform .08s;
}
.sf-btn:hover:not(:disabled) {
    background: var(--sf-btn-hover-bg);
    border-color: var(--sf-btn-hover-border);
    color: var(--sf-btn-fg);
}
.sf-btn:active:not(:disabled) { transform: translateY(1px); }
.sf-btn:disabled, .sf-btn.disabled { opacity: .55; cursor: not-allowed; }

.sf-btn-primary {
    --sf-btn-bg: #2563eb;
    --sf-btn-fg: #fff;
    --sf-btn-border: #2563eb;
    --sf-btn-hover-bg: #1d4ed8;
    --sf-btn-hover-border: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37,99,235,.18);
}

.sf-btn-secondary {
    --sf-btn-bg: #fff;
    --sf-btn-fg: #1e293b;
    --sf-btn-border: rgba(15,23,42,.18);
    --sf-btn-hover-bg: rgba(37,99,235,.06);
    --sf-btn-hover-border: rgba(37,99,235,.45);
}
[data-bs-theme="dark"] .sf-btn-secondary {
    --sf-btn-bg: rgba(17,24,39,.55);
    --sf-btn-fg: rgba(255,255,255,.85);
    --sf-btn-border: rgba(255,255,255,.18);
    --sf-btn-hover-bg: rgba(37,99,235,.18);
    --sf-btn-hover-border: rgba(37,99,235,.60);
}

.sf-btn-danger {
    --sf-btn-bg: #fff;
    --sf-btn-fg: #b91c1c;
    --sf-btn-border: rgba(185,28,28,.35);
    --sf-btn-hover-bg: rgba(185,28,28,.08);
    --sf-btn-hover-border: rgba(185,28,28,.55);
}
[data-bs-theme="dark"] .sf-btn-danger {
    --sf-btn-bg: rgba(17,24,39,.55);
    --sf-btn-fg: #fca5a5;
    --sf-btn-border: rgba(252,165,165,.35);
}

.sf-btn-warning {
    --sf-btn-bg: #fff;
    --sf-btn-fg: #92400e;
    --sf-btn-border: rgba(146,64,14,.35);
    --sf-btn-hover-bg: rgba(146,64,14,.08);
    --sf-btn-hover-border: rgba(146,64,14,.55);
}

/* Ghost — no border, hover lifts to a soft tint. For tertiary actions in
 * tight spaces (table rows, dropdown items, inline editor toolbars). */
.sf-btn-ghost {
    --sf-btn-bg: transparent;
    --sf-btn-fg: #475569;
    --sf-btn-border: transparent;
    --sf-btn-hover-bg: rgba(15,23,42,.06);
    --sf-btn-hover-border: transparent;
    box-shadow: none;
}
[data-bs-theme="dark"] .sf-btn-ghost {
    --sf-btn-fg: rgba(255,255,255,.72);
    --sf-btn-hover-bg: rgba(255,255,255,.06);
}

/* Icon-only variant — square aspect, used for save/share affordances. */
.sf-btn-icon {
    padding: .4rem;
    min-width: 2rem;
    height: 2rem;
}

.sf-btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.sf-btn-lg { padding: .65rem 1.1rem; font-size: 1rem; }

/* sf-card-cover — top image on a card-grid tile (catalog cards, Saved tab). */
.sf-card-cover {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.sf-card-cover-fallback {
    height: 130px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.7);
    font-size: 2rem;
}

/* sf-save-toggle — small heart/star overlay in the top-right corner of a
 * card. Sits above the click-through link so toggling the form doesn't
 * also fire the card's main link. */
.sf-save-toggle {
    position: absolute;
    top: 0; right: 0;
    padding: 8px;
    margin: 0;
    z-index: 2;
}
.sf-save-toggle button {
    background: rgba(255,255,255,.85);
    border-radius: 50%;
    padding: 6px 8px;
    border: 0;
    line-height: 1;
}
[data-bs-theme="dark"] .sf-save-toggle button { background: rgba(17,24,39,.85); }

/* Thin progress bar variant — the default Bootstrap height (1rem) is too
 * heavy for inline-in-table use. */
.sf-progress { height: 6px; }
.sf-progress-thin { height: 5px; }


/* ---------- 6. Calendar ----------------------------------------------------
 * Monthly grid + day cells on /profile/calendar. Was inline-style on the
 * view; centralised here so the dashboard "next 5 due" can reuse colour
 * tokens if we want.
 */
.sf-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(15,23,42,.08);
    border: 1px solid rgba(15,23,42,.08);
    border-radius: 12px;
    overflow: hidden;
}
.sf-cal-head {
    background: var(--phoenix-card-bg, #fff);
    padding: .6rem;
    text-align: center;
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    color: rgba(0,0,0,.55);
}
.sf-cal-cell {
    background: var(--phoenix-card-bg, #fff);
    padding: .5rem;
    min-height: 6.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.sf-cal-cell.empty { background: rgba(15,23,42,.02); }
.sf-cal-cell.today { box-shadow: inset 0 0 0 2px var(--bs-primary); }
.sf-cal-date { font-size: .85rem; font-weight: 600; color: rgba(0,0,0,.7); }
.sf-cal-pill {
    display: block;
    padding: .15rem .4rem;
    border-radius: 6px;
    font-size: .7rem;
    line-height: 1.2;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sf-cal-pill.required { background: rgba(251,191,36,.18); color: #92400e; }
.sf-cal-pill.standard { background: rgba(59,130,246,.15); color: #1e40af; }

[data-bs-theme="dark"] .sf-cal-head { background: rgba(17,24,39,.55); color: rgba(255,255,255,.62); }
[data-bs-theme="dark"] .sf-cal-cell { background: rgba(17,24,39,.55); }
[data-bs-theme="dark"] .sf-cal-cell.empty { background: rgba(17,24,39,.32); }
[data-bs-theme="dark"] .sf-cal-date { color: rgba(255,255,255,.62); }
[data-bs-theme="dark"] .sf-cal-pill.required { background: rgba(251,191,36,.18); color: #fde68a; }
[data-bs-theme="dark"] .sf-cal-pill.standard { background: rgba(59,130,246,.18); color: #bfdbfe; }

@media (max-width: 768px) {
    .sf-cal-cell { min-height: 4rem; padding: .35rem; }
    .sf-cal-date { font-size: .7rem; }
    .sf-cal-pill { font-size: .55rem; padding: .1rem .25rem; }
}

/* sf-cal-day-strip — vertical "MAY / 14" date block used in upcoming lists. */
.sf-cal-day-strip {
    width: 48px;
    flex: 0 0 48px;
    text-align: center;
}
.sf-cal-day-strip .month {
    font-size: .7rem;
    color: rgba(0,0,0,.55);
    text-transform: uppercase;
}
.sf-cal-day-strip .day {
    font-weight: 800;
    font-size: 1.3rem;
    line-height: 1;
}
[data-bs-theme="dark"] .sf-cal-day-strip .month { color: rgba(255,255,255,.62); }


/* ---------- 7. Upload drop zone (Branding) -------------------------------- */
.sf-upload-dropZone {
    color: #0f3c4b;
    background-color: var(--phoenix-card-color);
    outline: 2px dashed rgb(110, 120, 145);
    outline-offset: -12px;
    border-radius: 12px;
    transition: outline-offset .2s ease-out, outline-color .3s ease-in-out, background-color .2s ease-out;
}
.sf-upload-dropZone.highlight {
    outline-offset: -4px;
    outline-color: var(--primary, #0576bd);
    background-color: var(--primary, #c8dadf);
}
.sf-upload-svg { fill: var(--primary, #0576bd); }
.sf-upload-img { width: calc(33.333% - (2rem / 3)); object-fit: contain; }


/* ---------- 8. Reports event rows ----------------------------------------- */
.sf-ev-row { display: grid; grid-template-columns: 11rem 1fr 4rem; gap: 12px; align-items: center; padding: 6px 0; }
.sf-ev-row code { font-size: .8rem; }
.sf-ev-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg,#8b5cf6,#6366f1); }


/* ---------- 9. Status rings ----------------------------------------------- */
.sf-card.ring-warning,
.sf-stat.ring-warning,
.ring-warning { box-shadow: inset 0 0 0 2px var(--bs-warning); }
.sf-card.ring-danger,
.sf-stat.ring-danger,
.ring-danger  { box-shadow: inset 0 0 0 2px var(--bs-danger); }


/* ---------- 10. Gradient palette ------------------------------------------
 * Apply alongside .sf-icon-circle or .sf-kpi .icon to colour the disc.
 */
.sf-grad-users    { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.sf-grad-learner  { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.sf-grad-project  { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.sf-grad-catalog  { background: linear-gradient(135deg, #16a34a, #0d9488); }
.sf-grad-billing  { background: linear-gradient(135deg, #16a34a, #0d9488); }
.sf-grad-people   { background: linear-gradient(135deg, #7f7fd5, #86a8e7); }
.sf-grad-settings { background: linear-gradient(135deg, #64748b, #475569); }
.sf-grad-integ    { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.sf-grad-reports  { background: linear-gradient(135deg, #fbb03b, #fd746c); }
.sf-grad-audit    { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.sf-grad-events   { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.sf-grad-enroll   { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.sf-grad-done     { background: linear-gradient(135deg, #16a34a, #0d9488); }
.sf-grad-usage    { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.sf-grad-plan     { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.sf-grad-portal   { background: linear-gradient(135deg, #16a34a, #0d9488); }
.sf-grad-stripe   { background: linear-gradient(135deg, #635bff, #3a3aff); }
.sf-grad-zoom     { background: linear-gradient(135deg, #2d8cff, #0b5cff); }
.sf-grad-faa      { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.sf-grad-email    { background: linear-gradient(135deg, #ea4335, #b8261b); }
.sf-grad-slack    { background: linear-gradient(135deg, #611f69, #ecb22e); }
.sf-grad-ai       { background: linear-gradient(135deg, #10b981, #6366f1); }


/* ---------- 16. System Admin dashboard -------------------------------------
 * Primitives for /system (the Operations landing page). The page is signal-
 * first by design: pulse hero on top, incidents + activity feed beneath,
 * compact navigation strip last. Each piece is its own primitive so it can
 * be reused on other dashboards later.
 */

/* The hero band — health dot + a row of clickable KPI tiles. */
.sf-pulse-hero {
    background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(126,75,255,.05));
    border: 1px solid var(--sf-border, rgba(15,23,42,.10));
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 12px 40px rgba(15,23,42,.06);
    margin-bottom: 18px;
}
.sf-pulse-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.sf-pulse-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255,255,255,.55);
}
.sf-pulse-dot-ok       { background: #16a34a; }
.sf-pulse-dot-quiet    { background: #94a3b8; }
.sf-pulse-dot-degraded { background: #f59e0b; }
.sf-pulse-dot-critical { background: #dc2626; animation: sf-pulse-blink 1.4s ease-in-out infinite; }
@keyframes sf-pulse-blink {
    0%, 100% { box-shadow: 0 0 0 4px rgba(220,38,38,.20); }
    50%      { box-shadow: 0 0 0 8px rgba(220,38,38,.05); }
}
.sf-pulse-title {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--sf-ink, #0f172a);
    letter-spacing: -.01em;
}
.sf-pulse-state {
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 4px 10px;
    border-radius: 999px;
}
.sf-pulse-state-ok       { background: rgba(22,163,74,.12);  color: #166534; }
.sf-pulse-state-quiet    { background: rgba(100,116,139,.14); color: #334155; }
.sf-pulse-state-degraded { background: rgba(245,158,11,.18); color: #92400e; }
.sf-pulse-state-critical { background: rgba(220,38,38,.14);  color: #991b1b; }
[data-bs-theme="dark"] .sf-pulse-state-ok       { background: rgba(34,197,94,.18);  color: #86efac; }
[data-bs-theme="dark"] .sf-pulse-state-quiet    { background: rgba(148,163,184,.20); color: #cbd5e1; }
[data-bs-theme="dark"] .sf-pulse-state-degraded { background: rgba(245,158,11,.22); color: #fcd34d; }
[data-bs-theme="dark"] .sf-pulse-state-critical { background: rgba(248,113,113,.20); color: #fca5a5; }

.sf-pulse-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 991.98px) { .sf-pulse-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 575.98px) { .sf-pulse-kpis { grid-template-columns: 1fr; } }

.sf-pulse-kpi {
    background: var(--sf-card, #fff);
    border: 1px solid var(--sf-border, rgba(15,23,42,.08));
    border-radius: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.sf-pulse-kpi:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15,23,42,.08);
    border-color: rgba(37,99,235,.30);
    color: inherit;
}
.sf-pulse-kpi-label {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .7rem;
    font-weight: 700;
    color: var(--sf-muted, #64748b);
}
.sf-pulse-kpi-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--sf-ink, #0f172a);
}
.sf-pulse-kpi-sub {
    font-size: .8rem;
    color: var(--sf-muted, #64748b);
    margin-top: 2px;
}
.sf-pulse-kpi-sub.is-up    { color: #b91c1c; }
.sf-pulse-kpi-sub.is-down  { color: #166534; }
.sf-pulse-kpi-sub.is-good  { color: #166534; }
.sf-pulse-kpi-sub.is-bad   { color: #b91c1c; }
[data-bs-theme="dark"] .sf-pulse-kpi-sub.is-up   { color: #fca5a5; }
[data-bs-theme="dark"] .sf-pulse-kpi-sub.is-down { color: #86efac; }
[data-bs-theme="dark"] .sf-pulse-kpi-sub.is-good { color: #86efac; }
[data-bs-theme="dark"] .sf-pulse-kpi-sub.is-bad  { color: #fca5a5; }


/* Mini info card — used for the incidents-snapshot + activity feed +
   future jobs/billing/security cards. Shorter than .sf-card, denser
   header, click-through corner button. */
.sf-mini-card {
    background: var(--sf-card, #fff);
    border: 1px solid var(--sf-border, rgba(15,23,42,.10));
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15,23,42,.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.sf-mini-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sf-border2, rgba(15,23,42,.07));
}
.sf-mini-card-title {
    font-weight: 800;
    font-size: .95rem;
    color: var(--sf-ink, #0f172a);
    margin: 0;
}
.sf-mini-card-link {
    font-size: .78rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background .12s ease;
}
.sf-mini-card-link:hover { background: rgba(37,99,235,.08); color: #1d4ed8; }
[data-bs-theme="dark"] .sf-mini-card-link { color: #93c5fd; }
[data-bs-theme="dark"] .sf-mini-card-link:hover { background: rgba(96,165,250,.14); color: #bfdbfe; }
.sf-mini-card-body { padding: 14px 16px; flex: 1 1 auto; }


/* Health tiles — the "is the system OK right now?" top row.
   Four equal cards across; each card has a left-edge accent that flips
   colour by status (ok / warn / crit / unknown). */
.sf-health-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
    margin-top: 12px;
}
@media (max-width: 991.98px) { .sf-health-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 575.98px) { .sf-health-tiles { grid-template-columns: 1fr; } }

.sf-health-tile {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--sf-card, #fff);
    border: 1px solid var(--sf-border, rgba(15,23,42,.10));
    border-left-width: 4px;
    text-decoration: none;
    color: var(--sf-ink, #0f172a);
    transition: transform .08s ease, box-shadow .12s ease;
}
.sf-health-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(15,23,42,.06);
    color: var(--sf-ink, #0f172a);
}
[data-bs-theme="dark"] .sf-health-tile { background: rgba(15,23,42,.6); border-color: rgba(255,255,255,.10); color: #e2e8f0; }
[data-bs-theme="dark"] .sf-health-tile:hover { color: #f1f5f9; }

.sf-health-tile--ok      { border-left-color: #16a34a; }
.sf-health-tile--warn    { border-left-color: #f59e0b; }
.sf-health-tile--crit    { border-left-color: #dc2626; }
.sf-health-tile--unknown { border-left-color: #94a3b8; }

.sf-health-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.sf-health-tile-label {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--sf-muted, #64748b);
}
.sf-health-tile-badge {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(100,116,139,.14);
    color: #334155;
}
[data-bs-theme="dark"] .sf-health-tile-badge { background: rgba(148,163,184,.20); color: #cbd5e1; }
.sf-health-tile--ok   .sf-health-tile-badge { background: rgba(22,163,74,.14);  color: #166534; }
.sf-health-tile--warn .sf-health-tile-badge { background: rgba(245,158,11,.18); color: #92400e; }
.sf-health-tile--crit .sf-health-tile-badge { background: rgba(220,38,38,.14);  color: #991b1b; }
[data-bs-theme="dark"] .sf-health-tile--ok   .sf-health-tile-badge { background: rgba(34,197,94,.18);  color: #86efac; }
[data-bs-theme="dark"] .sf-health-tile--warn .sf-health-tile-badge { background: rgba(245,158,11,.22); color: #fcd34d; }
[data-bs-theme="dark"] .sf-health-tile--crit .sf-health-tile-badge { background: rgba(248,113,113,.20); color: #fca5a5; }

.sf-health-tile-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
}
.sf-health-tile-sub {
    font-size: .8rem;
    color: var(--sf-muted, #64748b);
}

.sf-pulse-hero-business {
    background: linear-gradient(135deg, rgba(16,185,129,.06), rgba(37,99,235,.05));
}

.sf-track-tight { letter-spacing: .06em; }


/* Activity row — used in the "who did what" feed (log_activity). */
.sf-activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--sf-border2, rgba(15,23,42,.06));
}
.sf-activity-row:last-child { border-bottom: 0; }
.sf-activity-icon {
    width: 32px; height: 32px;
    flex: 0 0 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37,99,235,.10);
    color: #1d4ed8;
    font-size: .9rem;
}
[data-bs-theme="dark"] .sf-activity-icon { background: rgba(96,165,250,.16); color: #93c5fd; }
[data-bs-theme="dark"] .sf-activity-row { border-bottom-color: rgba(255,255,255,.08); }
.sf-activity-main {
    flex: 1 1 auto;
    min-width: 0;
}
.sf-activity-line {
    font-size: .9rem;
    color: var(--sf-ink, #0f172a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sf-activity-meta {
    font-size: .78rem;
    color: var(--sf-muted, #64748b);
    margin-top: 1px;
}


/* Quick-nav strip — the demoted version of the legacy tile grid.
   Tight, icon-led, single row that wraps. */
.sf-nav-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sf-nav-strip a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--sf-border, rgba(15,23,42,.10));
    background: var(--sf-card, #fff);
    text-decoration: none;
    color: var(--sf-ink, #0f172a);
    font-weight: 700;
    font-size: .88rem;
    transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.sf-nav-strip a:hover {
    border-color: rgba(37,99,235,.35);
    background: rgba(37,99,235,.04);
    transform: translateY(-1px);
}
[data-bs-theme="dark"] .sf-nav-strip a:hover {
    border-color: rgba(96,165,250,.45);
    background: rgba(96,165,250,.10);
}
.sf-nav-strip a i {
    color: #1d4ed8;
    font-size: 1rem;
}
[data-bs-theme="dark"] .sf-nav-strip a i {
    color: #93c5fd;
}


/* ---------- 17. Quick search overlay (Ctrl/Cmd+K) --------------------------
 * Global jump-to across the Operations area. The script lives at
 * wwwroot/components/skillfull/operations/sf-quick-search.js and is
 * loaded by Areas/Operations/Views/Shared/_layout.cshtml.
 */
.sf-qsearch-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, .42);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.sf-qsearch-overlay.is-open { display: flex; }

.sf-qsearch-modal {
    background: var(--sf-card, #fff);
    color: var(--sf-ink, #0f172a);
    width: min(640px, 92vw);
    max-height: 70vh;
    border-radius: 14px;
    box-shadow: 0 30px 70px -10px rgba(15,23,42,.30), 0 8px 20px rgba(15,23,42,.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sfQsIn .14s ease-out;
}
@keyframes sfQsIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.sf-qsearch-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--sf-border2, rgba(15,23,42,.08));
}
.sf-qsearch-icon { color: var(--sf-muted, #64748b); font-size: 1rem; }
.sf-qsearch-input {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 1rem;
    color: var(--sf-ink, #0f172a);
}
.sf-qsearch-input::placeholder { color: var(--sf-muted, #64748b); }
.sf-qsearch-kbd {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--sf-muted, #64748b);
    background: rgba(15,23,42,.06);
    border-radius: 6px;
    padding: 3px 8px;
}

.sf-qsearch-results {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 0;
}
.sf-qsearch-group { padding: 6px 0; }
.sf-qsearch-group-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sf-muted, #64748b);
    padding: 6px 14px;
}
.sf-qsearch-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
}
.sf-qsearch-row.is-selected {
    background: rgba(37, 99, 235, .08);
    border-left-color: #2563eb;
}
.sf-qsearch-label { font-weight: 600; color: var(--sf-ink, #0f172a); }
.sf-qsearch-sublabel { font-size: .82rem; color: var(--sf-muted, #64748b); }

.sf-qsearch-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--sf-muted, #64748b);
}
.sf-qsearch-hint {
    padding: 8px 14px;
    border-top: 1px solid var(--sf-border2, rgba(15,23,42,.06));
    font-size: .76rem;
    color: var(--sf-muted, #64748b);
    background: rgba(15,23,42,.02);
}

/* Inline keyboard-shortcut hint chip used by the dashboard's quick-nav
   strip — small ⌘K / Ctrl K label next to the search entry. */
.sf-kbd-hint {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--sf-muted, #64748b);
    background: rgba(15,23,42,.06);
    border-radius: 4px;
    padding: 2px 5px;
    margin-left: 4px;
}


/* ----------------------------------------------------------------------
   Image fallback placeholders. Paired with wwwroot/js/sf-img-fallback.js
   which swaps `<img data-fallback="logo|avatar">` for a `<span>` of the
   same class list when the image fails to load (e.g. file is missing
   in S3, broken URL, 404). Inherits the original img's width/height/
   border-radius via class copying so circles stay circles, etc.
   --------------------------------------------------------------------- */
.sf-img-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #475569, #334155);
    color: rgba(255, 255, 255, .85);
    font-size: 1em;
    line-height: 1;
    overflow: hidden;
}
.sf-img-fallback i { font-size: inherit; }

.sf-img-fallback--avatar {
    background: linear-gradient(135deg, #1f2937, #0f172a);
    color: rgba(255, 255, 255, .75);
}
.sf-img-fallback--logo {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: rgba(15, 23, 42, .55);
}


.sf-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    margin-top: 32px;
    font-size: .82rem;
    color: var(--sf-muted, #64748b);
    border-top: 1px solid var(--sf-border2, rgba(15,23,42,.06));
    background: transparent;
}
.sf-footer-brand { font-weight: 700; color: var(--sf-ink, #0f172a); }
.sf-footer-sep { color: var(--sf-muted, #94a3b8); }
[data-bs-theme="dark"] .sf-footer-brand { color: #e2e8f0; }
[data-bs-theme="dark"] .sf-footer { border-top-color: rgba(255,255,255,.08); }


:root {
    --phoenix-body-color-rgb: 15, 23, 42;
    --phoenix-card-color: #ffffff;
    --phoenix-card-bg: #ffffff;
    --phoenix-border-color: rgba(15, 23, 42, .10);
    --phoenix-navbar-top-height: 4rem;
}

[data-bs-theme="dark"] {
    --phoenix-body-color-rgb: 241, 245, 249;
    --phoenix-card-color: #0f172a;
    --phoenix-card-bg: #0f172a;
    --phoenix-border-color: rgba(255, 255, 255, .10);
}
