/* Provero brand overrides on top of Tabler */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ─────────────────────────────────────────────────────────────
   CANONICAL DESIGN TOKENS — the single source of truth.
   Mirrored in CLAUDE.md and on the marketing site (provero.com.au).
   Do NOT use hex literals in code; reference tokens via var(--name).
   Hex literals in code are a bug — except in the Echo Rings logo SVG,
   which is treated as a static brand artifact (see note on --lp below).

   Token shifts vs prior versions of this codebase:
     --teal :  #0D9488 → #0F766E   (primary CTA shifts darker; conservative)
     --tl   :  #14B8A6 → #0D9488   (hover state inherits old primary teal)
     --deep :  #0A0416 → #07121F   (cyan-tinted dark navy, less mono-warm)
     --soft :  unified to #F3EEFA  (was split between #F0EBFA / #F5F0FF)
     --off  :  unified to #F6F8FB  (was split between #F4F6FA / #F8FAFC)
     --mid  :  #3B1D6E → #2B1954   (sharpened to match marketing site)
     --lp   :  sharpened to #5D4593 (matches marketing)
     --dark :  cooler body text #1d2939 (matches marketing)
     --ink  :  NEW #111827          (heading colour, distinct from --dark)
   ───────────────────────────────────────────────────────────── */
:root {
    /* Brand purples — Purple Reign */
    --deep: #07121F;
    --purple: #1E0A3C;
    --mid: #2B1954;
    --lp: #5D4593;
    --xp: #8B6FC0;
    --soft: #F3EEFA;

    /* Action teals */
    --teal: #0F766E;
    --tl: #0D9488;
    --mint: #5EEAD4;

    /* Strong semantics */
    --green: #10B981;
    --amber: #F59E0B;
    --red: #EF4444;

    /* Soft semantics — for status pill backgrounds */
    --green-soft: #DCFCE7;
    --amber-soft: #FEF3C7;
    --red-soft: #FEE2E2;

    /* Neutrals & surfaces */
    --ink: #111827;          /* Headings, page titles — slightly darker than body */
    --dark: #1d2939;         /* Body text */
    --slate: #64748B;
    --muted: #94A3B8;
    --white: #FFFFFF;
    --off: #F6F8FB;
    --border: #E5E7EB;

    /* Layout (NOT colour) */
    --provero-topbar: 56px;
    --provero-rail: 64px;

    /* ─── Tabler bridge ─── pipe the new tokens into Tabler's scale
       so all default Tabler primary/success/warning/danger components
       inherit Provero colours without per-component overrides. */
    --tblr-primary: var(--purple);
    --tblr-primary-rgb: 30,10,60;
    --tblr-success: var(--green);
    --tblr-warning: var(--amber);
    --tblr-danger: var(--red);
    --tblr-font-family: 'Poppins', var(--tblr-font-sans-serif);

    /* ─── Legacy aliases ─── kept so we can swap callers gradually
       without a flag day. New code MUST use the short names above. */
    --provero-purple: var(--purple);
    --provero-purple-soft: var(--soft);
    --provero-purple-lt: var(--lp);
    --provero-teal: var(--teal);
    --provero-red: var(--red);
    --provero-bg: var(--off);
    --provero-border: var(--border);
}

body {
    font-family: 'Poppins', var(--tblr-font-sans-serif);
    background: var(--off);
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--provero-topbar);
    background: var(--provero-purple);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 0 14px;
    z-index: 300;
}

.topbar-left,
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-logo { width: 38px; height: 36px; flex-shrink: 0; }
.topbar-brand { font-size: 18px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: #fff; }

/* Two-line user block: display name on top, role label below. The role
   line is ::before-style chip so the user always knows the lens they're
   browsing through (Compliance Officer vs Tenant Admin etc.). */
.topbar-user-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.15;
    gap: 2px;
}
.topbar-user-name { font-size: 13px; font-weight: 600; color: #fff; }
.topbar-user-role {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.62);
}

/* Search / command-palette trigger in the topbar. Looks like a search
   field but is a button — clicking opens the cmdk modal, same as
   Ctrl+K. The visible kbd shortcut hint is the most important part:
   reminds infrequent users the keyboard shortcut exists. */
.topbar-cmdk-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 10px 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.topbar-cmdk-btn:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.22);
    color: #fff;
}
.topbar-cmdk-btn i,
.topbar-cmdk-btn svg { width: 14px; height: 14px; }
.topbar-cmdk-label { color: inherit; }
.topbar-cmdk-kbd {
    font-family: 'Poppins', monospace;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,.25);
    color: rgba(255,255,255,.85);
    letter-spacing: .5px;
}
@media (max-width: 720px) {
    /* Tight topbars: keep the icon + kbd, drop the "Search" word. */
    .topbar-cmdk-label { display: none; }
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.12);
}

.topbar-avatar i,
.topbar-avatar svg { width: 16px; height: 16px; color: rgba(255,255,255,.76); }

.topbar-impersonating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.22);
}

.topbar-impersonating i { width: 14px; height: 14px; }

/* Impersonating group with tenant name */
.topbar-impersonating-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 12px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.topbar-impersonating-group > i {
    width: 14px;
    height: 14px;
    color: #fbbf24;
    flex-shrink: 0;
}
.topbar-imp-label {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.topbar-imp-tenant {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,.25);
    padding: 3px 10px;
    border-radius: 999px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Regular tenant badge (shown for tenant users, not superadmin) */
.topbar-tenant-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,.85);
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-tenant-badge i { width: 13px; height: 13px; flex-shrink: 0; opacity: .8; }

.topbar-exit-btn {
    font-size: 12px;
    color: rgba(255,255,255,.76);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    padding: 4px 10px;
    text-decoration: none;
}

.topbar-exit-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

.icon-rail {
    position: fixed;
    top: var(--provero-topbar);
    left: 0;
    bottom: 0;
    width: var(--provero-rail);
    background: #fff;
    border-right: 1px solid var(--provero-border);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* overflow on the rail itself is `visible` so the expand-on-hover
       width transition can show labels without clipping. The inner
       .rail-nav owns the scroll instead. */
    overflow: visible;
    z-index: 300;
    transition: width .18s ease, box-shadow .18s ease;
}

/* Hover-expand: rail grows to show labels + section headers WITHOUT
   reflowing the main content. We achieve this by keeping the layout
   gutter pinned to --provero-rail (64px) and letting the rail overflow
   on top of content when expanded. */
.icon-rail:hover,
.icon-rail:focus-within {
    width: 232px;
    box-shadow: 4px 0 18px rgba(15, 23, 42, .08);
}

.rail-nav,
.rail-bottom { display: flex; flex-direction: column; gap: 2px; }
.rail-nav { flex: 1; padding: 8px 0; overflow-y: auto; overflow-x: hidden; }
.rail-bottom { padding: 8px 0 12px; border-top: 1px solid var(--provero-border); }

/* Section blocks group related items with a soft heading. Headers are
   invisible when collapsed (no horizontal space for a label) and fade
   in when the rail expands. */
.rail-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 10px;
    position: relative;
}
.rail-section + .rail-section {
    border-top: 1px solid var(--provero-border);
}
.rail-section-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #94A3B8;
    padding: 4px 16px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity .15s ease, height .18s ease;
}
.icon-rail:hover .rail-section-header,
.icon-rail:focus-within .rail-section-header {
    opacity: 1;
    height: 22px;
}

/* Rail link: 44×44 icon target by default; on hover-expand it stretches
   to show the label inline with no jump (icon stays anchored left). */
.rail-link {
    display: flex;
    align-items: center;
    height: 40px;
    margin: 0 8px;
    padding: 0 10px;
    border-radius: 10px;
    color: #64748B;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
    position: relative;
    white-space: nowrap;
    /* Don't clip — let the inline label flow into the expanded rail.
       When collapsed, the parent .icon-rail's width:64px naturally
       hides the label region anyway. */
    overflow: visible;
}
/* Icon sizing — match BOTH the placeholder <i data-lucide="..."> and
   the post-Lucide <svg> that replaces it. Without the svg selector
   the SVG would fall back to Lucide's default 24px and, combined with
   the cramped rail width, render at the wrong size. */
.rail-link > i,
.rail-link > svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.7;
    flex-shrink: 0;
    color: inherit;
}
.rail-link .rail-label {
    /* CRITICAL: max-width:0 (not opacity:0) when collapsed. opacity:0
       still occupies layout space, which pushes the flex icon to shrink
       to invisibility in the 64-px collapsed rail. max-width:0 takes
       the label out of the layout entirely. */
    max-width: 0;
    margin-left: 0;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: max-width .18s ease, margin-left .18s ease, opacity .15s ease;
}
.icon-rail:hover .rail-link .rail-label,
.icon-rail:focus-within .rail-link .rail-label {
    max-width: 180px;
    margin-left: 14px;
    opacity: 1;
    pointer-events: auto;
}
.rail-link:hover { background: var(--provero-purple-soft); color: var(--provero-purple-lt); }
.rail-link.active {
    background: var(--provero-purple-soft);
    color: var(--provero-purple-lt);
    font-weight: 600;
}
.rail-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--provero-purple-lt);
}

/* Tooltip — only shown while rail is COLLAPSED. Once expanded, the
   inline label takes over and the tooltip would just duplicate it. */
.rail-link[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: var(--provero-purple);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
    z-index: 320;
}
.rail-link[data-tip]:hover::after { opacity: 1; transform: translateY(-50%); }
.icon-rail:hover .rail-link[data-tip]::after,
.icon-rail:focus-within .rail-link[data-tip]::after { opacity: 0 !important; }

/* Variants for the bottom-rail items: teal "Back to Platform" + red
   sign-out hover. Kept narrow — full styling lives on .rail-link above. */
.rail-platform { color: var(--provero-teal); }
.rail-platform:hover { background: #E6F7F5; color: var(--provero-teal); }
.rail-platform[data-tip]::after { background: #0f766e; }
.rail-logout:hover { background: #FEF2F2; color: var(--provero-red); }
.rail-logout[data-tip]::after { background: #991b1b; }

.main {
    margin-top: var(--provero-topbar);
    margin-left: var(--provero-rail);
    padding: 28px 28px 36px;
    min-height: calc(100vh - var(--provero-topbar));
}

.mobile-dock { display: none; }

@media (max-width: 860px) {
    .icon-rail { display: none; }
    .main { margin-left: 0; padding: 18px 14px 88px; }

    .mobile-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 70px;
        z-index: 280;
        display: flex;
        align-items: center;
        gap: 4px;
        overflow-x: auto;
        padding: 8px;
        background: rgba(255,255,255,.96);
        border-top: 1px solid var(--provero-border);
        backdrop-filter: blur(8px);
    }

    .mobile-dock a {
        min-width: 74px;
        flex: 1;
        height: 54px;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748B;
        gap: 4px;
    }

    .mobile-dock a,
    .mobile-dock button { /* the More button shares the dock styling */
        min-width: 64px;
        flex: 1;
        height: 54px;
        border: none;
        background: transparent;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748B;
        gap: 4px;
        cursor: pointer;
    }

    .mobile-dock a i,
    .mobile-dock a svg,
    .mobile-dock button i,
    .mobile-dock button svg { width: 18px; height: 18px; stroke-width: 1.8; }
    .mobile-dock a span,
    .mobile-dock button span { font-size: 11px; font-weight: 600; line-height: 1; }
    .mobile-dock a.active,
    .mobile-dock a:hover,
    .mobile-dock button:hover { background: var(--provero-purple-soft); color: var(--provero-purple); }
    .mobile-dock .dock-logout.active,
    .mobile-dock .dock-logout:hover { background: #FEF2F2; color: #B91C1C; }
}

/* Mobile overflow sheet — opens from the bottom when "More" is tapped.
   Mirrors the desktop rail's section grouping for muscle-memory parity. */
.mobile-more-backdrop,
.mobile-more-sheet { display: none; }

@media (max-width: 860px) {
    .mobile-more-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .42);
        z-index: 320;
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }
    .mobile-more-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 78vh;
        z-index: 330;
        background: #fff;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        padding: 8px 0 18px;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform .22s cubic-bezier(.2,.8,.2,1);
        display: block;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, .18);
    }
    body.mobile-more-open .mobile-more-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.mobile-more-open .mobile-more-sheet {
        transform: translateY(0);
    }
    .mobile-more-handle {
        width: 38px;
        height: 4px;
        border-radius: 999px;
        background: #CBD5E1;
        margin: 6px auto 12px;
    }
    .mobile-more-section { padding: 4px 8px 12px; }
    .mobile-more-section + .mobile-more-section {
        border-top: 1px solid var(--provero-border);
        padding-top: 12px;
    }
    .mobile-more-header {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .8px;
        text-transform: uppercase;
        color: #94A3B8;
        padding: 4px 16px 8px;
    }
    .mobile-more-link {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 18px;
        color: #1d2939;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
    }
    .mobile-more-link i,
    .mobile-more-link svg { width: 20px; height: 20px; color: var(--provero-purple-lt); flex-shrink: 0; }
    .mobile-more-link:active,
    .mobile-more-link:hover { background: var(--provero-purple-soft); }
}

/* ──────────────────────────────────────────────────────────────
   Command palette (Ctrl+K / Cmd+K)
   Hidden by default; .cmdk-open class on body shows the modal +
   backdrop. The modal itself is a centred sheet with a search
   input on top and grouped results below. JS handles filtering
   and keyboard navigation; the CSS just lays it out.
   ────────────────────────────────────────────────────────────── */
.cmdk-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(2px);
    z-index: 480;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}
.cmdk-modal {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: min(640px, calc(100vw - 28px));
    max-height: min(70vh, 540px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .26);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 490;
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
}
body.cmdk-open .cmdk-backdrop {
    opacity: 1;
    pointer-events: auto;
}
body.cmdk-open .cmdk-modal {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cmdk-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--provero-border);
}
.cmdk-input-icon,
i.cmdk-input-icon,
svg.cmdk-input-icon { width: 18px; height: 18px; color: #94A3B8; flex-shrink: 0; }
.cmdk-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: #1d2939;
    background: transparent;
}
.cmdk-input::placeholder { color: #94A3B8; }
.cmdk-esc {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
    background: #F1F5F9;
    color: #64748B;
}

.cmdk-results {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0 8px;
}
.cmdk-results-empty {
    padding: 32px 20px;
    text-align: center;
    color: #94A3B8;
    font-size: 13px;
}
.cmdk-section {
    padding: 4px 0 6px;
}
.cmdk-section-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #94A3B8;
    padding: 8px 16px 4px;
}
.cmdk-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #1d2939;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
}
.cmdk-result > i,
.cmdk-result > svg { width: 18px; height: 18px; color: var(--provero-purple-lt); flex-shrink: 0; }
.cmdk-result-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.cmdk-result-label { font-weight: 500; color: #1d2939; }
.cmdk-result-section { font-size: 11px; color: #94A3B8; }
.cmdk-result.active,
.cmdk-result:hover {
    background: var(--provero-purple-soft);
    color: var(--provero-purple);
}
.cmdk-result.active .cmdk-result-label,
.cmdk-result:hover .cmdk-result-label { color: var(--provero-purple); }
.cmdk-result-arrow {
    width: 14px;
    height: 14px;
    color: #CBD5E1;
    opacity: 0;
}
.cmdk-result.active .cmdk-result-arrow,
.cmdk-result:hover .cmdk-result-arrow { opacity: 1; }

.cmdk-footer {
    display: flex;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--provero-border);
    background: #FAFBFC;
    font-size: 11px;
    color: #94A3B8;
}
.cmdk-footer kbd {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 4px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--provero-border);
    color: #64748B;
    font-family: inherit;
    font-size: 10px;
}

/* ──────────────────────────────────────────────────────────────
   Floating action button — pinned bottom-right, surfaces the most
   common "log a new incident" action without giving it rail real
   estate. Each page can opt in by rendering data-page-fab.
   ────────────────────────────────────────────────────────────── */
.provero-fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 260;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 999px;
    background: var(--provero-teal);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(13, 148, 136, .32);
    transition: transform .12s ease, box-shadow .12s ease;
}
.provero-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(13, 148, 136, .42);
    color: #fff;
}
.provero-fab i { width: 18px; height: 18px; stroke-width: 2; }
@media (max-width: 860px) {
    /* Lift FAB above the mobile dock so they don't overlap. */
    .provero-fab { bottom: 92px; right: 18px; padding: 12px 18px; font-size: 13px; }
}

/* Sidebar dark purple */
.navbar-vertical { background: #1E0A3C; }
.navbar-vertical .navbar-brand { padding: 1rem; }
.provero-brand { font-size: 16px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #fff; }

/* Nav link icons from Lucide */
.nav-link-icon { width: 20px; height: 20px; margin-right: 8px; stroke-width: 1.6; }

/* Active nav item */
.navbar-vertical .nav-link.active { background: rgba(255,255,255,0.1); border-radius: 6px; }
.navbar-vertical .nav-link:hover { background: rgba(255,255,255,0.06); border-radius: 6px; }
.navbar-vertical .nav-link.active .nav-link-title { color: #fff; font-weight: 600; }
.navbar-vertical .nav-link-icon { opacity: 0.92; }

/* Purple avatar */
.bg-purple-lt { background: rgba(109,74,174,0.15) !important; color: #5D4593 !important; }

/* Improve card readability in dashboard and admin pages */
.card .subheader { text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.page-header .page-title { font-weight: 700; }
.card a.text-decoration-none { color: inherit; }

/* Consistent gap between the page header and the content (cards / rows) on every page.
   Tabler's default .page-header uses the shorthand `margin: var(--tblr-page-padding-y) 0 0`
   which explicitly sets margin-bottom to 0, making the title sit on top of the first card.
   !important is used here because the shorthand has equal specificity with this longhand
   override — without !important, the cascade result depends on load order and any stylesheet
   reorder would silently break the layout. */
.page-header { margin-bottom: 1.5rem !important; }
@media (max-width: 768px) {
    .page-header { margin-bottom: 1rem !important; }
}

/* Better mobile spacing with Tabler layout */
@media (max-width: 768px) {
    .page-body .container-xl { padding-left: .75rem; padding-right: .75rem; }
    .card-body { padding: .9rem; }
    .h1 { font-size: 1.5rem; }
}

/* Auth pages (no sidebar) */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f4f6fa; }
.auth-card { background: #fff; border-radius: 8px; padding: 2.5rem; max-width: 420px; width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.auth-card h1 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.25rem; }
.auth-card p { color: #667085; margin-bottom: 1.5rem; }
.auth-brand { font-size: 1.25rem; font-weight: 700; color: #1E0A3C; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 2rem; text-align: center; }
.auth-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.875rem; margin-bottom: 1rem; }
.auth-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #059669; padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.875rem; margin-bottom: 1rem; }
.auth-links { margin-top: 1.25rem; display: flex; justify-content: space-between; }
.auth-links a { font-size: 0.875rem; color: #0d9488; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* MFA */
.mfa-qr { display: flex; justify-content: center; margin: 1.5rem 0; }
.mfa-qr img { border-radius: 8px; border: 1px solid #e5e7eb; }
.mfa-manual { text-align: center; margin-bottom: 1.5rem; color: #667085; }
.mfa-manual code { display: block; margin-top: 0.5rem; background: #f4f6fa; padding: 0.75rem; border-radius: 6px; letter-spacing: 3px; }

/* Status badges */
.badge-active { background: #ecfdf5; color: #059669; }
.badge-inactive { background: #fef2f2; color: #dc2626; }

/* Tenant option buttons (select-tenant page) */
.tenant-option { display: block; width: 100%; padding: 1rem; border-radius: 8px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; text-align: left; margin-bottom: 0.5rem; transition: all 0.15s; }
.tenant-option:hover { border-color: #0d9488; background: #f0fdfa; }
.tenant-option strong { display: block; font-size: 0.9375rem; font-weight: 600; }
.tenant-option span { font-size: 0.8125rem; color: #667085; }

/* Mobile dock (hidden on desktop) */
.mobile-dock { display: none; }

/* Skip link */
.skip-link {
    position: absolute; top: -100px; left: 0;
    background: #1E0A3C; color: #fff; padding: 8px 16px; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* Back link */
.back-link { font-size: 0.875rem; color: #0d9488; text-decoration: none; display: inline-block; margin-bottom: 0.5rem; }
.back-link:hover { text-decoration: underline; }

/* Provision steps */
.provision-step { display: flex; gap: 0.75rem; align-items: flex-start; }
.step-num { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: rgba(109,74,174,0.12); color: #5D4593; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; font-weight: 600; }
.provision-step strong { display: block; font-size: 0.8125rem; margin-bottom: 2px; }
.provision-step p { font-size: 0.75rem; color: #667085; margin: 0; line-height: 1.4; }

/* Form hint */
.form-hint-custom { font-size: 0.75rem; color: #667085; margin-top: 0.25rem; }

/* ──────────────────────────────────────────────────────────────
   In-app help — topbar button + /help page
   The button sits right of the cmdk search; the page is a two-column
   reader (sidebar nav + rendered guide) opened in a new tab so users
   never lose their place in the workflow they were doing.
   ────────────────────────────────────────────────────────────── */

/* Topbar "?" button. Same dimensions as the avatar so the right-side
   trio (cmdk · help · avatar) reads as a balanced row. */
.topbar-help-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.72);
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
    flex-shrink: 0;
}
.topbar-help-btn:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.22);
    color: #fff;
}
.topbar-help-btn i,
.topbar-help-btn svg { width: 16px; height: 16px; stroke-width: 1.8; }

/* Help page shell — sits inside the standard layout (rail + topbar
   still visible) so users can navigate elsewhere without tab-hopping.
   Two columns: 240-px sidebar, content centred in remaining space. */
.help-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
    margin: 0 auto;
    max-width: 1180px;
}
.help-sidebar {
    position: sticky;
    top: calc(var(--provero-topbar) + 28px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 12px;
    max-height: calc(100vh - var(--provero-topbar) - 56px);
    overflow-y: auto;
}
.help-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--purple);
    font-size: 13px;
    letter-spacing: .3px;
}
.help-sidebar-head i,
.help-sidebar-head svg { width: 16px; height: 16px; color: var(--lp); }
.help-sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.help-sidebar-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--slate);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .12s ease, color .12s ease;
}
.help-sidebar-link:hover { background: var(--soft); color: var(--purple); }
.help-sidebar-link.active {
    background: var(--soft);
    color: var(--purple);
    font-weight: 600;
}
.help-sidebar-foot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.help-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lp);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.help-back-link i,
.help-back-link svg { width: 13px; height: 13px; }
.help-back-link:hover { color: var(--purple); }

/* Rendered guide content — readable column, plenty of leading. */
.help-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px 44px 56px;
    min-height: 60vh;
    position: relative;
}

/* On-this-page floating panel toggle (mobile-friendly TOC). */
.help-toc-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--lp);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    margin-bottom: 18px;
    width: fit-content;
}
.help-toc-toggle:hover { background: #EBE3F7; }
.help-toc-toggle i,
.help-toc-toggle svg { width: 14px; height: 14px; }
.help-toc {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    background: var(--off);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 24px;
}
.help-toc-link {
    color: var(--slate);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
}
.help-toc-link:hover { color: var(--purple); text-decoration: underline; }
.help-toc-h3 { padding-left: 16px; font-size: 12px; }

/* Markdown-rendered styles. Tuned for long-form reading at 14-15px
   with generous leading; aged-care managers reading on a laptop in a
   meeting need this readable, not designer-precious. */
.help-rendered { color: var(--dark); font-size: 14.5px; line-height: 1.65; }
.help-rendered h1 {
    font-family: 'Instrument Serif', 'Poppins', serif;
    font-size: 32px;
    line-height: 1.15;
    color: var(--purple);
    margin: 0 0 12px;
    letter-spacing: -.3px;
}
.help-rendered h2 {
    font-size: 20px;
    color: var(--purple);
    margin: 32px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: calc(var(--provero-topbar) + 16px);
}
.help-rendered h3 {
    font-size: 16px;
    color: var(--purple);
    margin: 22px 0 8px;
    scroll-margin-top: calc(var(--provero-topbar) + 16px);
}
.help-rendered h4 {
    font-size: 14px;
    color: var(--lp);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin: 18px 0 6px;
    font-weight: 700;
}
.help-rendered p { margin: 0 0 12px; }
.help-rendered a { color: var(--teal); text-decoration: none; }
.help-rendered a:hover { color: var(--tl); text-decoration: underline; }
.help-rendered ul,
.help-rendered ol { margin: 0 0 16px; padding-left: 22px; }
.help-rendered li { margin-bottom: 4px; }
.help-rendered li > p { margin-bottom: 4px; }
.help-rendered code {
    background: var(--soft);
    color: var(--purple);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: 'Poppins', monospace;
}
.help-rendered pre {
    background: var(--off);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.55;
    margin: 0 0 18px;
}
.help-rendered pre code { background: transparent; color: var(--dark); padding: 0; }
.help-rendered blockquote {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-left: 3px solid var(--lp);
    background: var(--soft);
    border-radius: 0 8px 8px 0;
    color: var(--purple);
}
.help-rendered table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 22px;
    font-size: 13px;
}
.help-rendered th,
.help-rendered td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.help-rendered th {
    background: var(--soft);
    color: var(--purple);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.help-rendered tr:nth-child(even) td { background: var(--off); }
.help-rendered hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 28px 0;
}
.help-rendered img { max-width: 100%; border-radius: 8px; }

/* Below 980px: collapse the sidebar into a top-of-page accordion +
   hide the static sidebar; the slide-out TOC handles in-page nav. */
@@media (max-width: 980px) {
    .help-shell {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }
    .help-sidebar {
        position: static;
        max-height: none;
    }
    .help-content { padding: 24px 22px 40px; }
    .help-toc-toggle { display: inline-flex; }
    body.help-toc-open .help-toc { display: flex; }
    .help-rendered h1 { font-size: 26px; }
    .help-rendered h2 { font-size: 17px; }
}

/* ──────────────────────────────────────────────────────────────
   Security notices — banner stack at the top of the main column.
   Lives in the Layout, above page content. Amber-tinted so they
   don't compete with red error states; assertive enough that a
   user actively notices but not so loud that they reflexively
   click "dismiss" without reading.
   ────────────────────────────────────────────────────────────── */
.security-notice-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--amber-soft);
    border: 1px solid #FBBF24;
    color: #78350F;
    box-shadow: 0 4px 12px rgba(245, 158, 11, .08);
}
.security-notice-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(245, 158, 11, .18);
    color: #B45309;
    display: flex;
    align-items: center;
    justify-content: center;
}
.security-notice-icon i,
.security-notice-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.security-notice-body { flex: 1; min-width: 0; }
.security-notice-title {
    font-weight: 700;
    font-size: 14px;
    color: #78350F;
    margin-bottom: 4px;
}
.security-notice-text {
    font-size: 13px;
    line-height: 1.55;
    color: #92400E;
}
.security-notice-time {
    font-size: 11px;
    color: #B45309;
    margin-top: 6px;
    font-family: 'Poppins', monospace;
    letter-spacing: .2px;
}
.security-notice-dismiss-form { flex-shrink: 0; }
.security-notice-dismiss {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #92400E;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease;
}
.security-notice-dismiss:hover { background: rgba(245, 158, 11, .15); }
.security-notice-dismiss i,
.security-notice-dismiss svg { width: 16px; height: 16px; stroke-width: 2; }
