/* Rubix Alert — shell polish, help drawer and dashboard.
   Ported from the Rubix Hub admin shell so the two products look like one family.
   Theme-agnostic (sits over whichever Bootstrap theme is selected).

   Brand palette: navy #0F2A47 · blue #2B7CB0 · cyan #5BC2E7 · orange #E18829
   Severity palette is separate and deliberately fixed — see the --rbx-sev-* tokens.
   A colour on this product means a severity, so nothing decorative may reuse them. */

:root {
    --rbx-navy: #0f2a47;
    --rbx-blue: #2b7cb0;
    --rbx-cyan: #5bc2e7;
    --rbx-orange: #e18829;
    --rbx-green: #2e9b6b;
    --rbx-red: #c0392b;
    --rbx-grey: #dfe6ee;
    --rbx-muted: #6b7d90;

    /* Severity scale, lightest to heaviest. Used by the dashboard, the help
       legend and the alert list appearance rules. */
    --rbx-sev-info: #7d8ea0;
    --rbx-sev-low: #2b7cb0;
    --rbx-sev-moderate: #e1a629;
    --rbx-sev-high: #e18829;
    --rbx-sev-critical: #c0392b;
}

/* ---------------------------------------------------------------- Shell */
/* Branded gradient header spanning the full width, matching Rubix Hub. The
   header carries navbar-dark, so child text and icons stay light. */
#main-window-template-component .header {
    background: linear-gradient(135deg, #0f2a47 0%, #2b7cb0 60%, #5bc2e7 100%) !important;
    border-bottom: 0 !important;
    box-shadow: 0 1px 6px rgba(15, 42, 71, .25);
    color: #fff;
}

/* The logo is masked with currentColor in site.css, so on the gradient it
   renders as a clean white wordmark. Only the sizing is set here. */
#main-window-template-component .rbx-shell-logo {
    width: 32px;
    height: 26px;
}

.rbx-shell-brand { line-height: 1.15; display: flex; flex-direction: column; justify-content: center; }
.rbx-shell-title { font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: .2px; }
.rbx-shell-sub { font-size: .66rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: #d7ecf8; }

#main-window-template-component .header .header-right-side,
#main-window-template-component .header [role="heading"] { color: #fff; }

@media (max-width: 640px) {
    .rbx-shell-brand { display: none; }
}

.dxbl-navbar .dxbl-active,
.nav-item.active { color: var(--rbx-blue); }

/* ------------------------------------------------------------ Help drawer */
/* Deliberately a hand-rolled drawer rather than a DxPopup: it lives in the
   application window template, outside any view, and needs to stay open while
   the user navigates between views. A plain CSS panel has no interop timing to
   get wrong and no z-index fight with XAF's own popups. */

.rbx-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    border-radius: 999px;
    padding: 4px 13px 4px 10px;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
    white-space: nowrap;
}
.rbx-help-btn:hover, .rbx-help-btn:focus-visible {
    background: rgba(255, 255, 255, .26);
    border-color: rgba(255, 255, 255, .5);
    color: #fff;
}
.rbx-help-btn .rbx-help-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    color: var(--rbx-navy);
    font-weight: 900;
    font-size: .72rem;
}
/* On narrow screens the circled ? carries the meaning on its own. */
@media (max-width: 900px) {
    .rbx-help-btn .rbx-help-word { display: none; }
    .rbx-help-btn { padding: 4px 8px; }
}

.rbx-help-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 42, 71, .35);
    z-index: 100000;
    animation: rbx-fade-in .12s ease;
}

.rbx-help-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(560px, 100vw);
    background: #fff;
    box-shadow: -12px 0 40px rgba(15, 42, 71, .28);
    z-index: 100001;
    display: flex;
    flex-direction: column;
    animation: rbx-slide-in .16s ease;
}

@keyframes rbx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rbx-slide-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .rbx-help-scrim, .rbx-help-panel { animation: none; }
}

.rbx-help-head {
    background: linear-gradient(135deg, #0f2a47 0%, #2b7cb0 100%);
    color: #fff;
    padding: 16px 18px 14px;
    flex: 0 0 auto;
}
.rbx-help-head-row { display: flex; align-items: center; gap: 10px; }
.rbx-help-title { font-size: 1.1rem; font-weight: 800; flex: 1; }
.rbx-help-close {
    background: rgba(255, 255, 255, .16);
    border: 0;
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.rbx-help-close:hover { background: rgba(255, 255, 255, .3); }

.rbx-help-search {
    width: 100%;
    margin-top: 12px;
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .88rem;
    color: var(--rbx-navy);
}
.rbx-help-search::placeholder { color: #9fb0c0; }

.rbx-help-crumbs {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 18px;
    background: #f4f8fb;
    border-bottom: 1px solid #e6ecf2;
    font-size: .76rem;
    color: var(--rbx-muted);
    flex: 0 0 auto;
}
.rbx-help-back {
    background: none; border: 0; padding: 0;
    color: var(--rbx-blue); font-weight: 700; cursor: pointer; font-size: .76rem;
}
.rbx-help-back:hover { text-decoration: underline; }

.rbx-help-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 28px; }

.rbx-help-section {
    font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--rbx-blue); margin: 16px 0 8px; display: flex; align-items: center; gap: 10px;
}
.rbx-help-section:first-child { margin-top: 0; }
.rbx-help-section::after { content: ""; flex: 1; height: 1px; background: rgba(43, 124, 176, .18); }

.rbx-help-topic {
    display: flex; align-items: flex-start; gap: 10px;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #e6ecf2;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.rbx-help-topic:hover {
    border-color: var(--rbx-blue);
    box-shadow: 0 4px 14px rgba(15, 42, 71, .1);
    transform: translateY(-1px);
}
.rbx-help-topic-icon { font-size: 1.1rem; line-height: 1.3; }
.rbx-help-topic-text { flex: 1; min-width: 0; }
.rbx-help-topic-title { font-weight: 700; color: var(--rbx-navy); font-size: .9rem; }
.rbx-help-topic-sub { color: var(--rbx-muted); font-size: .78rem; margin-top: 2px; }
.rbx-help-topic-badge {
    background: #e8f4fb; color: var(--rbx-blue);
    font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    border-radius: 4px; padding: 2px 6px; align-self: center; white-space: nowrap;
}

.rbx-help-empty { color: #8b9aa8; font-size: .85rem; padding: 26px 0; text-align: center; }

/* ---- rendered topic HTML ------------------------------------------------
   Help bodies are authored as HTML in HelpContent.cs, so the styling lives here
   rather than being repeated inline in every topic. */
.rbx-help-article { color: #2b3b4b; font-size: .88rem; line-height: 1.55; }
.rbx-help-article h3 {
    font-size: 1.05rem; font-weight: 800; color: var(--rbx-navy);
    margin: 18px 0 6px;
}
.rbx-help-article h3:first-child { margin-top: 0; }
.rbx-help-article h4 {
    font-size: .82rem; font-weight: 800; color: var(--rbx-blue);
    text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 6px;
}
.rbx-help-article p { margin: 0 0 10px; }
.rbx-help-article ul, .rbx-help-article ol { margin: 0 0 12px; padding-left: 20px; }
.rbx-help-article li { margin-bottom: 5px; }
.rbx-help-article code {
    background: #eef3f8; color: var(--rbx-navy);
    border-radius: 4px; padding: 1px 5px;
    font-size: .84em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.rbx-help-article strong { color: var(--rbx-navy); }
.rbx-help-article a { color: var(--rbx-blue); }

.rbx-help-article table {
    width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: .84rem;
}
.rbx-help-article th {
    text-align: left; background: #f4f8fb; color: var(--rbx-navy);
    font-weight: 700; padding: 7px 9px; border-bottom: 2px solid #e6ecf2;
}
.rbx-help-article td { padding: 7px 9px; border-bottom: 1px solid #eef2f6; vertical-align: top; }

.rbx-help-article .rbx-note,
.rbx-help-article .rbx-warn {
    border-radius: 8px; padding: 10px 13px; margin: 0 0 14px;
    border-left: 4px solid var(--rbx-blue); background: #f2f8fc;
}
.rbx-help-article .rbx-warn { border-left-color: var(--rbx-orange); background: #fdf5ec; }
.rbx-help-article .rbx-note p:last-child,
.rbx-help-article .rbx-warn p:last-child { margin-bottom: 0; }

.rbx-help-article .rbx-steps { counter-reset: rbx-step; list-style: none; padding-left: 0; }
.rbx-help-article .rbx-steps > li {
    counter-increment: rbx-step;
    position: relative;
    padding-left: 30px;
    margin-bottom: 10px;
}
.rbx-help-article .rbx-steps > li::before {
    content: counter(rbx-step);
    position: absolute; left: 0; top: 1px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--rbx-blue); color: #fff;
    font-size: .72rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

.rbx-help-related { margin-top: 22px; padding-top: 14px; border-top: 1px solid #e6ecf2; }

/* ------------------------------------------------------------- Dashboard */
.rbx-dash { padding: 18px 22px 28px; }
.rbx-dash-welcome { font-size: 1.5rem; font-weight: 800; color: var(--rbx-navy); margin-bottom: 2px; }
.rbx-dash-sub { color: var(--rbx-muted); margin-bottom: 22px; }

.rbx-dash-section {
    font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px;
    color: var(--rbx-blue); margin: 18px 0 12px; display: flex; align-items: center; gap: 10px;
}
.rbx-dash-section::after { content: ""; flex: 1; height: 1px; background: rgba(43, 124, 176, .18); }

.rbx-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.rbx-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 18px 16px;
    box-shadow: 0 2px 12px rgba(15, 42, 71, .07);
    border-left: 4px solid var(--rbx-blue);
    display: flex; flex-direction: column; gap: 6px;
    transition: transform .12s ease, box-shadow .12s ease;
}
.rbx-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15, 42, 71, .14); }
.rbx-card-icon { font-size: 1.5rem; line-height: 1; }
.rbx-card-value { font-size: 2rem; font-weight: 800; color: var(--rbx-navy); line-height: 1.05; }
.rbx-card-label { color: var(--rbx-muted); font-size: .82rem; font-weight: 600; }
.rbx-card-note { color: #8b9aa8; font-size: .72rem; }

.rbx-card-navy { border-left-color: var(--rbx-navy); }
.rbx-card-blue { border-left-color: var(--rbx-blue); }
.rbx-card-cyan { border-left-color: var(--rbx-cyan); }
.rbx-card-orange { border-left-color: var(--rbx-orange); }
.rbx-card-green { border-left-color: var(--rbx-green); }
/* Red means "a human needs to do something". Nothing decorative may use it. */
.rbx-card-red { border-left-color: var(--rbx-red); }

/* ---- dashboard charts -------------------------------------------------------
   Inline SVG sized by its container: the viewBox carries the geometry, CSS carries
   the width, so charts reflow with the navigation panel without JS resize handling. */
.rbx-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 6px;
}

.rbx-chart, .rbx-chart-wide {
    background: #fff;
    border: 1px solid #e6ecf2;
    border-radius: 10px;
    padding: 14px 16px;
}
.rbx-chart-wide { margin-bottom: 6px; }

.rbx-chart-title { font-size: .82rem; font-weight: 700; color: var(--rbx-navy); margin-bottom: 10px; }

.rbx-svg-trend { width: 100%; height: 120px; display: block; }
.rbx-svg-bar { width: 100%; height: 10px; display: block; }
.rbx-svg-donut { width: 100%; max-width: 150px; height: 150px; display: block; margin: 0 auto; }

.rbx-donut-total { font-size: 7px; font-weight: 800; fill: #0f2a47; }
.rbx-donut-cap { font-size: 3px; fill: #6b7d90; text-transform: uppercase; letter-spacing: .08em; }

.rbx-chart-legend {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
    font-size: .74rem; color: var(--rbx-muted);
}
.rbx-legend-item { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.rbx-legend-item i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.rbx-legend-note { margin-left: auto; font-style: italic; }

.rbx-chart-empty { color: #8b9aa8; font-size: .82rem; padding: 22px 0; text-align: center; }

.rbx-gauge-value { font-size: 2rem; font-weight: 800; color: var(--rbx-navy); line-height: 1.05; }
.rbx-gauge-sub { color: var(--rbx-muted); font-size: .8rem; font-weight: 600; margin-bottom: 10px; }
.rbx-gauge-note { color: #8b9aa8; font-size: .74rem; margin-top: 8px; }

.rbx-horizon { display: flex; flex-direction: column; gap: 9px; }
.rbx-horizon-row { display: grid; grid-template-columns: 78px 1fr 34px; align-items: center; gap: 8px; }
.rbx-horizon-label { font-size: .74rem; font-weight: 600; color: var(--rbx-muted); }
.rbx-horizon-count { font-size: .8rem; font-weight: 700; color: var(--rbx-navy); text-align: right; }

/* ---- compliance readiness strip ----------------------------------------
   The one thing on this page that blocks shipping: an un-registered SMS
   campaign means no texts go anywhere, so it gets its own treatment. */
.rbx-ready {
    display: flex; align-items: center; gap: 16px;
    background: #fff; border: 1px solid #e6ecf2; border-left: 4px solid var(--rbx-green);
    border-radius: 10px; padding: 14px 16px; margin-bottom: 6px;
}
.rbx-ready-blocked { border-left-color: var(--rbx-orange); }
.rbx-ready-dial { flex: 0 0 auto; width: 74px; height: 74px; }
.rbx-ready-text { flex: 1; min-width: 0; }
.rbx-ready-title { font-weight: 800; color: var(--rbx-navy); font-size: .95rem; }
.rbx-ready-sub { color: var(--rbx-muted); font-size: .8rem; margin-top: 2px; }
.rbx-ready-gaps { margin: 8px 0 0; padding-left: 18px; color: #7a5b30; font-size: .78rem; }
.rbx-ready-gaps li { margin-bottom: 3px; }
.rbx-ready-dial-pct { font-size: 9px; font-weight: 800; fill: #0f2a47; }
