/*
 * Ported from PSC's inline <style> blocks in resources/views/layouts/app.blade.php
 * and resources/views/auth/login.blade.php.
 *
 * --color-primary / --color-accent were already CSS custom properties in PSC's
 * original (fed from Tenant::primaryColor()/accentColor()) — that part worked
 * correctly. Everything else (--sb-bg, --teal, --gold, and ~20 tint/shade
 * variants like --teal-light/--teal-pale/--ink/--ink-muted) was a *second*,
 * hardcoded copy of the same two brand colors, so a differently-branded
 * install would need to hunt down and override 20+ variables individually to
 * actually re-skin the admin shell.
 *
 * Fixed here with color-mix(): every tint/shade below is now computed from
 * --color-primary/--color-accent at load time. Override just the two root
 * colors per install and the whole palette follows — this is what makes the
 * canonical stylesheet itself never need touching per install, per the brief.
 * The two hex values below are PSC's real brand colors, kept as the package
 * DEFAULT only — each consuming app overrides them via a small per-org
 * <style> block reading Tenant::primaryColor()/accentColor() (see the
 * layout's inline :root override, which still exists for exactly this).
 */
:root {
    --color-primary: #006378;
    --color-accent: #eabe07;
    --font-base: 'Inter', ui-sans-serif, system-ui, sans-serif;

    /* Sidebar tokens */
    --sb-width: 240px;
    --sb-bg: var(--color-primary);
    --sb-border: rgba(255, 255, 255, .07);
    --sb-text: rgb(255, 255, 255);
    --sb-text-active: #ffffff;
    --sb-hover-bg: color-mix(in srgb, var(--color-primary) 18%, transparent);
    --sb-active-bg: var(--color-accent);
    --sb-active-rule: var(--color-accent);
    /* gold left-border on active item */

    /* Surface */
    --surface: color-mix(in srgb, var(--color-primary) 3%, #f4f7f8);
    --surface-card: #ffffff;
    --border-ui: #e2e8ec;

    /* Teal palette for components — all derived from --color-primary now */
    --teal: var(--color-primary);
    --teal-mid: color-mix(in srgb, var(--color-primary) 85%, black);
    --teal-light: color-mix(in srgb, var(--color-primary) 15%, white);
    --teal-pale: color-mix(in srgb, var(--color-primary) 6%, white);
    --gold: var(--color-accent);
    --ink: color-mix(in srgb, var(--color-primary) 30%, black);
    --ink-muted: color-mix(in srgb, var(--color-primary) 55%, #708790);
    --ink-faint: color-mix(in srgb, var(--color-primary) 25%, #b7c6cb);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    background: var(--surface);
    margin: 0;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sb-width);
    background: var(--sb-bg);
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .08) transparent;
}

#sidebar-overlay {
    z-index: 49;
}

/* ── Logo area ───────────────────────────────────── */
.sidebar-logo {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--sb-border);
    display: flex;
    align-items: center;
    gap: .75rem;
    position: relative;
}

/* Gold accent rule under logo */
.sidebar-logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: linear-gradient(90deg, var(--gold) 0%, transparent 60%);
    opacity: .35;
}

.sidebar-logo img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: contain;
    background: rgb(255, 255, 255);
    padding: 3px;
    flex-shrink: 0;
}

.sidebar-logo-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.sidebar-logo-sub {
    font-size: .65rem;
    color: rgba(255, 255, 255, 0.541);
    line-height: 1.3;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

/* ── Nav sections & items ────────────────────────── */
.sidebar-nav {
    padding: .75rem 0;
    flex: 1;
}

.nav-section {
    padding: .625rem 1rem .3rem;
    font-size: .6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .25);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5625rem 1rem;
    color: var(--sb-text);
    font-size: .8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
    position: relative;
}

.nav-item:hover {
    background: var(--sb-hover-bg);
    color: var(--sb-text-active);
}

.nav-item.active {
    background: var(--sb-active-bg);
    color: var(--sb-text-active);
}

/* Gold rule for active item */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--sb-active-rule);
    border-radius: 0 2px 2px 0;
}

.nav-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: .7;
}

/* Inline action icons (Statements show-page header buttons etc.), where the
   icon sits inside a button/link that already has its own background. */
.icon-inline svg {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

/* Row action icon buttons (Statements index / Correspondence tab) — each
   icon gets a consistent chip hit-area instead of floating bare in a row.
   View is plain (simple navigation, no chip); Print gets a neutral chip;
   Email gets a teal-tinted chip since it's the one action that leaves the
   system (sending to the patient), worth a visual nudge. */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .5rem;
    border: none;
    color: var(--ink-muted);
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease;
}
.icon-btn svg {
    width: 15px;
    height: 15px;
}
.icon-btn:hover {
    background: var(--surface);
}
.icon-btn-view {
    color: var(--teal);
}
.icon-btn-chip {
    background: var(--surface);
}
.icon-btn-chip:hover {
    background: var(--border-ui);
}
.icon-btn-primary {
    background: var(--teal-pale);
    color: var(--teal-mid);
}
.icon-btn-primary:hover {
    background: var(--teal-light);
}

.nav-item.active svg {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: color-mix(in srgb, var(--color-primary) 70%, transparent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, .2);
}

/* ── Submenu ─────────────────────────────────────── */
.nav-parent {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5625rem 1rem;
    color: var(--sb-text);
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s;
    user-select: none;
}

.nav-parent:hover {
    background: var(--sb-hover-bg);
    color: var(--sb-text-active);
}

.nav-parent svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: .7;
}

.nav-chevron {
    margin-left: auto;
    width: 13px !important;
    height: 13px !important;
    transition: transform .2s;
}

.nav-parent.open .nav-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    background: rgba(0, 0, 0, .15);
}

.nav-submenu.open {
    display: block;
}

.nav-submenu .nav-item {
    padding-left: 2.625rem;
    font-size: .75rem;
}

/* ── Sidebar footer ──────────────────────────────── */
.sidebar-footer {
    padding: .875rem 1rem;
    border-top: 1px solid var(--sb-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .625rem;
}

.sidebar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sb-active-bg);
    border: 1.5px solid rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6875rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: .65rem;
    color: rgba(255, 255, 255, .35);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ════════════════════════════════════════════════════
   MAIN WRAPPER
════════════════════════════════════════════════════ */
.main-wrap {
    margin-left: var(--sb-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top bar ─────────────────────────────────────── */
.topbar {
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-ui);
    padding: 0 1.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--ink);
    /* Truncate long page titles (e.g. a patient's name) instead of
       wrapping — .topbar has a fixed height, so wrapped text overlapped
       .topbar-right's own content instead of the row growing. */
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.topbar-meta {
    font-size: .75rem;
    color: var(--ink-faint);
}

/* Teal pill for HPCSA */
.topbar-hpcsa {
    font-size: .7rem;
    font-weight: 500;
    color: var(--teal);
    background: var(--teal-pale);
    border: 1px solid color-mix(in srgb, var(--color-primary) 15%, transparent);
    border-radius: 2rem;
    padding: .25rem .75rem;
}

/* ── Flash messages ──────────────────────────────── */
.flash-wrap {
    padding: 1rem 1.5rem 0;
}

.flash-success {
    background: var(--teal-pale);
    border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    color: var(--teal-mid);
    border-radius: .5rem;
    padding: .75rem 1rem;
    font-size: .8125rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.flash-error {
    background: #fdf2f2;
    border: 1px solid rgba(192, 57, 43, .2);
    color: #c0392b;
    border-radius: .5rem;
    padding: .75rem 1rem;
    font-size: .8125rem;
}

.flash-warning {
    background: #fefce8;
    border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
    color: color-mix(in srgb, var(--color-accent) 60%, black);
    border-radius: .5rem;
    padding: .75rem 1rem;
    font-size: .8125rem;
}

.flash-icon {
    width: .875rem;
    height: .875rem;
    flex-shrink: 0;
}

/* ── Page content ────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* ── Mobile table scroll ─────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    min-width: 600px;
}

@media(max-width:768px) {
    .topbar-title {
        font-size: .875rem;
    }

    .page-content {
        padding: 1rem;
    }

    /* Allow buttons to wrap */
    .btn-group {
        flex-wrap: wrap !important;
        gap: .375rem !important;
    }
}

/* ── Shared component tokens ─────────────────────── */
.btn-primary {
    background: var(--color-primary);
    color: #fff;
    padding: .5rem 1rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: filter .15s;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(.9);
}

.text-primary {
    color: var(--color-primary);
}

.border-primary {
    border-color: var(--color-primary);
}

.bg-primary {
    background-color: var(--color-primary);
}

.text-accent {
    color: var(--color-accent);
}

.bg-accent {
    background-color: var(--color-accent);
}

/* ── Footer ──────────────────────────────────────── */
.main-footer {
    background: var(--surface-card);
    border-top: 1px solid var(--border-ui);
    padding: .75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: .6875rem;
    color: var(--ink-faint);
}

.main-footer strong {
    color: var(--teal);
}

/* ════════════════════════════════════════════════════
   MODAL z-index overrides (preserved)
════════════════════════════════════════════════════ */
#medicine-modal,
#payment-modal,
#upload-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
}

/* ════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrap {
        margin-left: 0 !important;
    }
}

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 640px) {
    .topbar-hpcsa {
        display: none;
    }

    /* Today's date is convenience chrome, not essential — dropping it
       gives the (truncated) page title and profile dropdown the width
       they need on a phone-sized topbar. */
    .topbar-meta {
        display: none;
    }
}

/* Session panel — full viewport, escape the layout's main padding */
#session-fullscreen {
    margin: -1.75rem;
    height: calc(100vh - 3.5rem);
    /* subtract header height */
}

/* ════════════════════════════════════════════════════
   LOGIN / AUTH SCREENS (login.blade.php, 2FA views)
════════════════════════════════════════════════════ */
.auth-body {
    background: color-mix(in srgb, var(--color-primary) 92%, black);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.auth-body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -20%;
    width: 70vw;
    height: 70vw;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--color-primary) 12%, transparent);
    pointer-events: none;
}

.auth-body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -15%;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--color-accent) 7%, transparent);
    pointer-events: none;
}

.auth-card {
    background: #fff;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 32px 72px rgba(0, 0, 0, .45);
    position: relative;
    z-index: 1;
}

.auth-card-header {
    background: var(--teal);
    padding: 2.25rem 2rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold);
}

.auth-card-header::before {
    content: '';
    position: absolute;
    top: -3rem;
    right: -3rem;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .07);
    pointer-events: none;
}

.auth-header-logo {
    width: 6rem;
    height: 6rem;
    background: rgba(255, 255, 255, 0.979);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.125rem;
}

.auth-header-logo img {
    max-width: 4.5rem;
    max-height: 4.5rem;
}

.auth-header-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: .25rem;
    letter-spacing: -.01em;
}

.auth-header-sub {
    font-size: .75rem;
    color: rgba(255, 255, 255, .5);
    text-transform: uppercase;
    letter-spacing: .09em;
}

.auth-card-body {
    padding: 2.25rem 2rem 2rem;
}

.auth-body-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .3rem;
}

.auth-body-desc {
    font-size: .8125rem;
    color: var(--ink-muted);
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-label {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .5rem;
}

.auth-form-input {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
    border-radius: .5rem;
    padding: .75rem 1rem;
    font-size: .9375rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    background: var(--teal-pale);
}

.auth-form-input::placeholder {
    color: var(--ink-faint);
}

.auth-form-input:focus {
    border-color: color-mix(in srgb, var(--color-primary) 55%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 9%, transparent);
    background: #fff;
}

.auth-form-input.is-error {
    border-color: #e74c3c;
}

.auth-error-msg {
    font-size: .75rem;
    color: #c0392b;
    margin-top: .375rem;
}

.auth-alert-error {
    background: #fdf2f2;
    border: 1px solid rgba(192, 57, 43, .2);
    border-radius: .5rem;
    padding: .75rem 1rem;
    margin-bottom: 1.375rem;
    font-size: .8125rem;
    color: #c0392b;
}

.auth-alert-success {
    background: var(--teal-pale);
    border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    border-radius: .5rem;
    padding: .75rem 1rem;
    margin-bottom: 1.375rem;
    font-size: .8125rem;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.auth-alert-success svg {
    width: .875rem;
    height: .875rem;
    flex-shrink: 0;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.auth-remember-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    color: var(--ink-muted);
    cursor: pointer;
}

.auth-remember-label input {
    accent-color: var(--color-primary);
    cursor: pointer;
}

.auth-forgot-link {
    font-size: .8125rem;
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
    transition: opacity .15s;
}

.auth-forgot-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-btn-submit {
    width: 100%;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: .5rem;
    padding: .875rem;
    font-size: .9375rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
    letter-spacing: .01em;
}

.auth-btn-submit:hover {
    background: var(--teal-mid);
}

.auth-btn-submit:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.auth-card-footer {
    padding: 1.125rem 2rem;
    background: var(--teal-pale);
    border-top: 1px solid color-mix(in srgb, var(--color-primary) 8%, transparent);
    text-align: center;
}

.auth-card-footer p {
    font-size: .75rem;
    color: var(--ink-faint);
    line-height: 1.65;
}

.auth-card-footer strong {
    color: var(--ink-muted);
}

/* 2FA icon circles reused across setup/challenge screens */
.auth-icon-circle {
    background: var(--teal-pale);
}

.auth-icon-circle svg {
    stroke: var(--teal);
}

.auth-btn-teal {
    background: var(--teal);
}

/* ════════════════════════════════════════════════════
   SYSTEM HELP PORTAL
   Adapted from the qwahabedi/ortho reference (same tab+accordion+quiz+
   tracker structure), restyled onto this package's own teal/ink/gold/
   border-ui tokens instead of the reference's hardcoded green/maroon
   palette, so it re-skins per practice automatically via
   Tenant::primaryColor(), same as every other screen in this app.
════════════════════════════════════════════════════ */

.help-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.help-stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border-ui);
    border-radius: .875rem;
    padding: 1rem 1.25rem;
}

.help-stat-card .help-stat-label {
    font-size: .7rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.help-stat-card .help-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--teal-mid);
    margin-top: .25rem;
}

.help-tabs {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-ui);
    margin-bottom: 1.5rem;
}

.help-tab {
    padding: .65rem 1.1rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--ink-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.help-tab:hover {
    color: var(--ink);
}

.help-tab.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
    font-weight: 600;
}

.help-panel {
    animation: helpFadeIn .15s ease;
}

@keyframes helpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.help-card {
    background: var(--surface-card);
    border: 1px solid var(--border-ui);
    border-radius: .875rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.help-card-accent {
    border-left: 4px solid var(--teal);
}

.help-card-gold {
    border-left: 4px solid var(--gold);
}

.help-h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 .5rem;
}

.help-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.help-eyebrow-block {
    font-size: .7rem;
    font-weight: 700;
    color: var(--teal-mid);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .3rem;
}

.help-notice {
    background: var(--teal-pale);
    border: 1px solid var(--border-ui);
    border-left: 4px solid var(--gold);
    padding: 1rem 1.25rem;
    border-radius: .5rem;
    margin-bottom: 1.25rem;
    font-size: .85rem;
    color: var(--ink-muted);
}

.help-pill {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: .2rem .65rem;
    border-radius: 1rem;
    text-transform: none;
}

.help-pill-mandatory { background: #fef2f2; color: #b91c1c; }
.help-pill-clinical { background: var(--teal-pale); color: var(--teal-mid); }
.help-pill-admin { background: var(--teal-pale); color: var(--teal-mid); }
.help-pill-billing { background: #fef9e7; color: #92720a; }
.help-pill-core { background: #f3f4f6; color: #4b5563; }
.help-pill-gate { background: var(--gold); color: #1b2a30; }

/* Role cards */
.help-role-card {
    background: var(--surface-card);
    border: 1px solid var(--border-ui);
    border-top: 4px solid var(--teal);
    border-radius: .875rem;
    padding: 1.25rem 1.5rem;
}

.help-role-card h3 {
    font-size: .95rem;
    margin: .5rem 0 .3rem;
}

.help-role-desc {
    font-size: .8rem;
    color: var(--ink-muted);
    margin-bottom: .75rem;
}

.help-module-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .8rem;
    color: var(--ink);
}

.help-module-list li {
    padding: .3rem 0;
    border-top: 1px solid var(--border-ui);
}

.help-module-list li:first-child {
    border-top: none;
}

/* Learning path (vertical timeline) */
.help-path-item {
    display: flex;
    gap: 1rem;
    margin-bottom: .25rem;
}

.help-path-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.help-path-dot {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.help-path-dot.gold {
    background: var(--gold);
    color: #1b2a30;
}

.help-path-line {
    width: 2px;
    flex: 1;
    background: var(--border-ui);
    margin: .25rem 0;
}

.help-path-content {
    padding-bottom: 1.5rem;
}

.help-path-duration {
    font-size: .7rem;
    font-weight: 600;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.help-path-content h3 {
    font-size: .9rem;
    margin: .2rem 0 .35rem;
}

.help-path-content p {
    font-size: .8125rem;
    color: var(--ink-muted);
    margin: 0 0 .5rem;
}

/* Accordion (module guides) */
.help-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface-card);
    border: 1px solid var(--border-ui);
    border-radius: .625rem;
    padding: .85rem 1.1rem;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.help-accordion-btn:hover {
    background: var(--teal-pale);
}

.help-chevron {
    color: var(--ink-faint);
    flex-shrink: 0;
}

.help-module-body {
    display: none;
    border: 1px solid var(--border-ui);
    border-top: none;
    border-radius: 0 0 .625rem .625rem;
    padding: 1.25rem 1.25rem 1.5rem;
    margin-top: -1px;
    background: #fff;
}

.help-module-body h4 {
    font-size: .85rem;
    color: var(--teal-mid);
    margin: 1rem 0 .4rem;
}

.help-module-body h4:first-child {
    margin-top: 0;
}

.help-scenario-steps {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.help-scenario-step {
    display: flex;
    gap: .75rem;
    font-size: .82rem;
    color: var(--ink-muted);
    align-items: flex-start;
}

.help-step-num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--teal-pale);
    color: var(--teal-mid);
    font-weight: 700;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Scenarios tab */
.help-scenario {
    background: var(--surface-card);
    border: 1px solid var(--border-ui);
    border-radius: .875rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.help-scenario-eyebrow {
    font-size: .7rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .3rem;
}

.help-scenario h3 {
    font-size: .95rem;
    margin: 0 0 .3rem;
}

/* Quiz */
.help-quiz-container {
    background: var(--surface-card);
    border: 1px solid var(--border-ui);
    border-radius: .875rem;
    padding: 1.5rem;
}

.help-quiz-q {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 1rem;
}

.help-quiz-options {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.help-quiz-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-align: left;
    padding: .75rem 1rem;
    border: 1px solid var(--border-ui);
    border-radius: .625rem;
    background: #fff;
    font-size: .85rem;
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
}

.help-quiz-option:hover:not(:disabled) {
    border-color: var(--teal);
    background: var(--teal-pale);
}

.help-quiz-option:disabled {
    cursor: default;
}

.help-quiz-option.correct {
    border-color: #15803d;
    background: #f0fdf4;
}

.help-quiz-option.wrong {
    border-color: #dc2626;
    background: #fef2f2;
}

.help-opt-letter {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-ui);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.help-quiz-feedback {
    display: none;
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: .5rem;
    font-size: .8125rem;
    line-height: 1.5;
}

.help-quiz-feedback.show {
    display: block;
}

.help-quiz-feedback.correct {
    background: #f0fdf4;
    color: #15803d;
}

.help-quiz-feedback.wrong {
    background: #fef2f2;
    color: #b91c1c;
}

.help-quiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-ui);
    flex-wrap: wrap;
    gap: 1rem;
}

.help-quiz-progress {
    font-size: .8rem;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    gap: .6rem;
}

.help-progress-bar {
    width: 100px;
    height: 6px;
    background: var(--border-ui);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
}

.help-progress-fill {
    display: block;
    height: 100%;
    background: var(--teal);
    transition: width .2s ease;
}

/* Glossary */
.help-glossary-item {
    padding: .85rem 0;
    border-top: 1px solid var(--border-ui);
}

.help-glossary-item:first-child {
    border-top: none;
    padding-top: 0;
}

.help-glossary-term {
    font-weight: 600;
    color: var(--ink);
    font-size: .875rem;
    margin-bottom: .2rem;
}

.help-glossary-def {
    font-size: .8125rem;
    color: var(--ink-muted);
    line-height: 1.55;
}

/* Cheat sheet quick-ref grid */
.help-qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}

.help-qr-item {
    background: var(--teal-pale);
    border-radius: .625rem;
    padding: .75rem 1rem;
}

.help-shortcut {
    font-weight: 600;
    font-size: .8rem;
    color: var(--teal-mid);
}

.help-shortcut-desc {
    font-size: .75rem;
    color: var(--ink-muted);
    margin-top: .15rem;
}

/* Progress tracker */
.help-tracker {
    background: var(--surface-card);
    border: 1px solid var(--border-ui);
    border-radius: .875rem;
    padding: 1.25rem 1.5rem;
}

.help-tracker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.help-tracker-header h3 {
    font-size: .9rem;
    margin: 0;
}

.help-score {
    font-size: .8rem;
    font-weight: 700;
    color: var(--teal-mid);
    background: var(--teal-pale);
    padding: .2rem .65rem;
    border-radius: 1rem;
}

.help-tracker-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border-top: 1px solid var(--border-ui);
}

.help-tracker-row:first-child {
    border-top: none;
}

.help-tracker-check {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: .3rem;
    border: 1.5px solid var(--border-ui);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.help-tracker-check.done {
    background: var(--teal);
    border-color: var(--teal);
}

.help-tracker-label {
    font-size: .8125rem;
    color: var(--ink);
}

.help-tracker-label.done-text {
    color: var(--ink-faint);
    text-decoration: line-through;
}
