/* RegSphere — shared styles for list, detail, and grid cells.
   Scope-free (loaded globally from App.razor) because pill spans are rendered
   inside DevExpress cell templates that live outside razor CSS isolation. */

:root {
    --rs-navy:        #0a3d62;
    --rs-teal:        #00a896;
    --rs-blue:        #1a6fd4;
    --rs-amber:       #d97706;
    --rs-red:         #dc2626;
    --rs-green:       #059669;
    --rs-bg:          #f0f4f8;
    --rs-card:        #ffffff;
    --rs-border:      #e2e8f0;
    --rs-text:        #1a1a2e;
    --rs-text-mid:    #4a5568;
    --rs-text-light:  #94a3b8;
}

/* =========================================================
   Sub-nav — sibling links across top-level RegSphere pages
   ========================================================= */
.rs-subnav {
    display: flex; gap: 0; align-items: stretch;
    padding: 0 20px;
    background: var(--rs-card);
    border-bottom: 1px solid var(--rs-border);
}
.rs-subnav__link {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--rs-text-mid);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.1s ease, border-color 0.1s ease;
}
.rs-subnav__link:hover {
    color: var(--rs-navy);
}
.rs-subnav__link--active {
    color: var(--rs-navy);
    font-weight: 600;
    border-bottom-color: var(--rs-teal);
}
.rs-subnav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--rs-teal);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

/* =========================================================
   KPI cards — above the case list, clickable to filter
   ========================================================= */
.rs-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
    padding: 0 20px 12px;
    background: #fff;
}
.rs-kpi {
    background: var(--rs-card);
    border: 1px solid var(--rs-border);
    border-left: 4px solid var(--rs-teal);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: flex; flex-direction: column; gap: 2px;
}
.rs-kpi:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(10,61,98,0.12);
}
.rs-kpi.rs-kpi-active {
    background: #f0f9f7;
    border-left-color: var(--rs-teal);
    box-shadow: 0 0 0 2px rgba(0,168,150,0.25);
}
.rs-kpi-label { font-size: 11px; color: var(--rs-text-mid); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.rs-kpi-value { font-size: 22px; font-weight: 700; color: var(--rs-navy); line-height: 1.1; }
.rs-kpi-sub   { font-size: 11px; color: var(--rs-text-light); }

/* Accent variants — left border colour per KPI */
.rs-kpi-total    { border-left-color: var(--rs-navy); }
.rs-kpi-open     { border-left-color: var(--rs-blue); }
.rs-kpi-due      { border-left-color: var(--rs-amber); }
.rs-kpi-overdue  { border-left-color: var(--rs-red); }
.rs-kpi-filed    { border-left-color: var(--rs-teal); }

/* =========================================================
   Filter bar
   ========================================================= */
.rs-filter-bar {
    display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center;
    padding: 10px 20px;
    background: var(--rs-card);
    border-top: 1px solid var(--rs-border);
    border-bottom: 1px solid var(--rs-border);
}
.rs-filter-bar label { font-size: 11px; color: var(--rs-text-mid); margin-right: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.rs-filter-field { min-width: 180px; }

/* =========================================================
   Status pill — used in grid cells AND detail header
   ========================================================= */
.rs-status-pill {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 10px; border-radius: 11px;
    font-size: 11px; font-weight: 600;
    min-width: 100px;
    letter-spacing: 0.2px;
}
.rs-status-not_started      { background: #e2e8f0; color: var(--rs-text-mid); }
.rs-status-in_progress      { background: #dbeafe; color: var(--rs-blue); }
.rs-status-under_review     { background: #fef3c7; color: var(--rs-amber); }
.rs-status-evidence_required{ background: #fee2e2; color: var(--rs-red); }
.rs-status-ready_for_filing { background: #d1fae5; color: var(--rs-green); }
.rs-status-filed            { background: var(--rs-teal); color: #fff; }
.rs-status-overdue          { background: var(--rs-red); color: #fff; }
.rs-status-cancelled        { background: #e5e7eb; color: #6b7280; text-decoration: line-through; }
.rs-status-reopened         { background: #ede9fe; color: #6b46c1; }

/* =========================================================
   Regime badge — ES / FATCA / CRS / FISC
   ========================================================= */
.rs-regime-pill {
    display: inline-block;
    padding: 2px 8px; border-radius: 4px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    min-width: 54px; text-align: center;
}
.rs-regime-es            { background: #e6f7f5; color: #00876e; border: 1px solid rgba(0,168,150,0.25); }
.rs-regime-fatca         { background: #ede9fe; color: #6b46c1; border: 1px solid rgba(107,70,193,0.25); }
.rs-regime-crs           { background: #dbeafe; color: var(--rs-blue); border: 1px solid rgba(26,111,212,0.25); }
.rs-regime-fiscalisation { background: #fef3c7; color: var(--rs-amber); border: 1px solid rgba(217,119,6,0.25); }
/* LW+CL:07.11.26 (parity pass, styling reader): BO and Annual Return pills were emitted by RegimePillClass with no rule, so they rendered unstyled. POC .regime-BO pink, second .regime-BO purple (used here for Annual Return). */
.rs-regime-bo            { background: #fce7f3; color: #be185d; border: 1px solid rgba(190,24,93,0.25); }
/* LW+CL:11.11.26 (C126) the regimes a regulatory source covers (Regulatory Sources grid): the POC's AML/CFT, Fiscalisation and IFRS pill colours. */
.rs-regime-aml-cft       { background: #ccfbf1; color: #0f766e; border: 1px solid rgba(15,118,110,0.25); }
.rs-regime-fisc          { background: #ecfdf5; color: #047857; border: 1px solid rgba(4,120,87,0.25); }
.rs-regime-ifrs          { background: #eef2ff; color: #4338ca; border: 1px solid rgba(67,56,202,0.25); }
.rs-regime-ar            { background: #f5f3ff; color: #5b21b6; border: 1px solid rgba(124,58,237,0.25); }

/* =========================================================
   Evidence flag indicator — Missing / Inconsistent / Risk
   Rendered via CellCssClassFunc in MyDxGrid. ✓ = flag cleared,
   coloured label = flag set.
   ========================================================= */
.rs-flag-pill {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 8px; border-radius: 10px;
    font-size: 10px; font-weight: 700; min-width: 70px;
    letter-spacing: 0.3px;
}
.rs-flag-ok      { background: #d1fae5; color: #065f46; }   /* green tick */
.rs-flag-missing { background: #fee2e2; color: var(--rs-red); }
.rs-flag-warn    { background: #fef3c7; color: var(--rs-amber); }
.rs-flag-risk    { background: #fee2e2; color: #fff; background: var(--rs-red); }
.rs-flag-info    { background: #dbeafe; color: #1e40af; }   /* LW+CL:08.11.26 parity pass 6: the POC's blue tone (Partly verified, CARF-3) */
.rs-flag-neutral { background: #e5e7eb; color: #6b7280; }   /* skipped — not a failure, nothing to action */
/* LW+CL:10.11.26 C69: a "Yes" in the ES Outsourced column, amber and bold (POC ws-es-poc.html:766). Here, not in CaseDetail.razor.css: a grid cell is outside the page's CSS scope. */
.rs-outsourced-yes { color: var(--rs-amber); font-weight: 600; }

/* =========================================================
   LiveFile lock badge — Documents grid "Lock" column.
   Rendered via MyGridColumn.CellCssClassFunc (see DocumentsViewer +
   DocumentLockBadge). Distinguishes a checkout held by YOU (amber —
   nudge to check it in) from one held by someone else (neutral), and a
   live Office (WebDAV) edit session (blue). Empty value → no pill.
   ========================================================= */
.lf-lock-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 11px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
    white-space: nowrap;
}
.lf-lock-pill::before { line-height: 1; }
.lf-lock-pill--you    { background: #fef3c7; color: #92600a; }
.lf-lock-pill--you::before    { content: "\1F512"; }   /* lock */
.lf-lock-pill--other  { background: #e2e8f0; color: var(--rs-text-mid); }
.lf-lock-pill--other::before  { content: "\1F512"; }   /* lock */
.lf-lock-pill--office { background: #dbeafe; color: var(--rs-blue); }
.lf-lock-pill--office::before { content: "\1F4DD"; }    /* memo / editing */
/* LW+CL:27.10.26 out for e-signature: locked for everyone until the envelope ends; no glyph */
.lf-lock-pill--signing { background: #ede9fe; color: #5b21b6; }

/* =========================================================
   LiveFile shared badge — Documents grid "Shared" column (#721).
   Rendered via MyGridColumn.CellCssClassFunc (see DocumentsViewer +
   DocumentSharedBadge). Marks a row whose PrimaryOwner=0 — a
   Shared-With association, not the owning entity's copy — so staff
   don't mistake it for an identical file with missing buttons.
   ========================================================= */
.lf-shared-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 11px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
    white-space: nowrap;
    background: #ede9fe; color: #6d28d9;
}
.lf-shared-pill::before { content: "\1F517"; line-height: 1; }   /* link */

/* Evidence progress pill — list column rendering "2/3" / "N/A". Colour
   classes are applied by EvidencePillClass based on collected vs required. */
.rs-ev-pill {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 10px; border-radius: 10px;
    font-size: 11px; font-weight: 700; min-width: 52px;
    font-variant-numeric: tabular-nums;
}
.rs-ev-ok       { background: #d1fae5; color: #065f46; }
.rs-ev-partial  { background: #fef3c7; color: var(--rs-amber); }
.rs-ev-missing  { background: #fee2e2; color: var(--rs-red); }
.rs-ev-na       { background: #f1f5f9; color: #64748b; }

/* FISC Invoice Stream — transmission-state pill. Only renders on the FISC tab. */
.rs-fisc-state-pill {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 10px; border-radius: 10px;
    font-size: 10px; font-weight: 700; min-width: 90px;
    letter-spacing: 0.3px;
}
.rs-fisc-state-queued       { background: #f1f5f9; color: #64748b; }
.rs-fisc-state-acknowledged { background: #d1fae5; color: #065f46; }
.rs-fisc-state-rejected     { background: #fee2e2; color: var(--rs-red); }
.rs-fisc-state-cancelled    { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }
.rs-fisc-state-receipt_confirmed { background: #047857; color: #ecfdf5; } /* LW+CL:07.11.26 POC .fq-status-receipt-confirmed; the Confirmed pill was unstyled */

/* FISC missing-TIN flag in the column — red text without a full pill so the
   grid stays readable but the gap is unmissable. */
.rs-fisc-tin-missing { color: var(--rs-red); font-style: italic; font-weight: 600; }

/* =========================================================
   Agent Briefing — deadline cards (/regsphere/briefing)
   ========================================================= */
.rs-agent-card {
    background: #fff;
    border: 1px solid var(--rs-border);
    border-left: 3px solid var(--rs-blue);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.rs-agent-card--overdue { border-left-color: var(--rs-red); background: #fef2f2; }
.rs-agent-card--urgent  { border-left-color: var(--rs-amber); }

.rs-agent-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.rs-agent-card__title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.rs-agent-card__ref    { font-family: 'SF Mono', Monaco, monospace; font-size: 11px; color: var(--rs-text-light); letter-spacing: 0.5px; }
.rs-agent-card__entity { font-size: 14px; font-weight: 600; color: var(--rs-navy); }
.rs-agent-card__juris  { font-size: 11px; color: var(--rs-text-mid); }

.rs-agent-card__meta {
    display: flex;
    gap: 18px;
    font-size: 11px;
    color: var(--rs-text-mid);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.rs-agent-card__meta-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rs-text-light);
    margin-bottom: 2px;
}

.rs-agent-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-agent-btn { font-size: 12px !important; }

/* Days-until-due urgency pill */
.rs-agent-days-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.rs-agent-days-overdue { background: #fee2e2; color: var(--rs-red); }
.rs-agent-days-urgent  { background: #fef3c7; color: var(--rs-amber); }
.rs-agent-days-soon    { background: #dbeafe; color: var(--rs-blue); }
.rs-agent-days-later   { background: #dcfce7; color: #15803d; }

/* Morning-briefing toast — slides in top-right, just under the 50px navbar. Bottom-right (AM+CL:06.09.26)
   hid the fixed Ask IQ FAB. Trade-off accepted per Brett 29.09.26: it can briefly sit over the Regulatory
   Cases header actions — dismissible and auto-hides after 12s. Matches .dash-reg-toast. LW+CL:29.09.26 */
.rs-agent-toast {
    position: fixed;
    top: 62px;
    right: 24px;
    background: linear-gradient(135deg, var(--rs-navy), var(--rs-teal));
    color: #fff;
    padding: 14px 38px 14px 18px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(10, 61, 98, 0.35);
    max-width: 320px;
    z-index: 5000;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    transform: translateX(120%);
    user-select: none;
}
.rs-agent-toast.rs-agent-toast--open { transform: translateX(0); }
.rs-agent-toast__title  { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.rs-agent-toast__body   { font-size: 12px; line-height: 1.5; }
.rs-agent-toast__close  { position: absolute; top: 6px; right: 10px; cursor: pointer; opacity: 0.7; font-size: 18px; line-height: 1; }
.rs-agent-toast__close:hover { opacity: 1; }

/* Muted explanatory caption sitting above FISC grids. */
.rs-tab-caption          { font-size: 12px; color: #4b5563; padding: 4px 2px 10px; }
.rs-tab-caption--muted   { color: #6b7280; font-style: italic; }

/* =========================================================
   Case detail header — navy gradient + meta-grid
   ========================================================= */
.rs-case-header {
    background: linear-gradient(135deg, #0a3d62 0%, #0d4b78 100%);
    color: #fff;
    padding: 16px 22px;
    border-radius: 8px;
    display: flex; flex-direction: column; gap: 10px;
    margin: 12px 20px 0;
}
.rs-case-header__top {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.rs-case-header__breadcrumb a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 12px;
}
.rs-case-header__breadcrumb a:hover { color: #fff; }
.rs-case-header__title {
    margin: 0;
    font-size: 20px; font-weight: 600;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.rs-case-header__ref {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
}
.rs-case-header__meta {
    display: flex; gap: 22px; flex-wrap: wrap;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 10px 0 0;
}
.rs-case-header__meta__item { display: flex; flex-direction: column; gap: 2px; }
.rs-case-header__meta__label { font-size: 10px; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.5px; }
.rs-case-header__meta__value { font-size: 13px; font-weight: 600; }

/* LW+CL:08.11.26 (parity pass 5). Moved here from an inline <style> in RegimesAndJurisdictions.razor, which leaked these rules
   globally: Classifications, Evidence Library and ES Activity Types use the same classes and only looked right once that page
   had been visited. A page's own scoped .razor.css still wins where it defines the same class. */
.regsphere-list { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0; }
.rs-page-header { padding: 12px 20px 8px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.rs-title { margin: 0; font-size: 1.15rem; font-weight: 600; color: #0a3d62; }
.rs-subtitle { font-size: 12px; color: #6b7280; }
.rs-subtitle code { font-family: monospace; font-size: 11px; background: #f3f4f6; padding: 1px 4px; border-radius: 3px; }
.rs-loading { padding: 1rem; color: #6b7280; }

/* LW+CL:08.11.26: classes the Regimes and Jurisdictions page emitted with no rule (errors and notes rendered as plain text). */
.rs-carf-note { color: #6b7280; font-size: 12px; margin: 0 0 8px; }
.rs-carf-error { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 8px 12px; margin-top: 8px; font-size: 13px; }
.rs-carf-preview { background: #f3f4f6; color: #374151; border-radius: 6px; padding: 8px 12px; margin-top: 8px; font-size: 13px; }
.rs-carf-unverified-key { color: #b45309; font-weight: 600; }

/* The small status pill on a case's overview (for example "Applied to case"). */
.rs-pill { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.rs-pill--filed { background: #d1fae5; color: #065f46; }
