/*
 * tabler-pulse.css — the Pulse design language on top of Tabler.
 *
 *   1. Tabler CSS variable overrides (brand colors)
 *   2. Base/global overrides (body, cards, typography scale)
 *   3. Sidebar chrome
 *   4. Top-bar chrome + trial banner
 *   5. Pulse KPI tile component
 *   6. Pulse score badge component
 *   7. Pulse page header
 *   8. Pulse row / list row
 *   9. Status dots + severity utilities
 *  10. Responsive rules — phone + tablet breakpoints
 *  11. Tap target + accessibility
 */

/* ============================================================ */
/* 1. Tabler variable overrides                                  */
/* ============================================================ */

:root {
    --tblr-primary: #2E75B6;
    --tblr-primary-rgb: 46, 117, 182;
    --tblr-primary-darker: #1F3864;
    --tblr-body-bg: #f5f7fa;

    --pulse-navy:          #1F3864;
    --pulse-blue:          #2E75B6;
    --pulse-green:         #22c55e;
    --pulse-orange:        #f59e0b;
    --pulse-red:           #ef4444;
    --pulse-purple:        #8b5cf6;
    --pulse-cyan:          #06b6d4;
    --pulse-text:          #1e293b;
    --pulse-text-muted:    #64748b;
    --pulse-text-faint:    #94a3b8;
    --pulse-border:        #e2e8f0;
    --pulse-border-subtle: #f0f2f5;
    --pulse-card-shadow:   0 1px 2px rgba(15, 23, 42, 0.04);
    --pulse-card-radius:   10px;
}

/* ============================================================ */
/* 2. Base / global                                              */
/* ============================================================ */

body {
    background-color: var(--tblr-body-bg);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    color: var(--pulse-text);
}

.page-body {
    padding-top: 1rem;
}

.card {
    border-radius: var(--pulse-card-radius);
    box-shadow: var(--pulse-card-shadow);
    border-color: var(--pulse-border);
}

.card-header {
    border-bottom-color: var(--pulse-border);
    padding: 14px 20px;
}

.card-header .card-title {
    font-weight: 600;
    color: var(--pulse-text);
    font-size: 15px;
}

.card-body {
    padding: 20px;
}

/* ============================================================ */
/* 3. Sidebar chrome                                             */
/* ============================================================ */

.navbar-vertical {
    border-right: 1px solid var(--pulse-border);
}

.navbar-brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}
.navbar-brand-text .brand-lead {
    color: var(--pulse-navy);
}
.navbar-brand-text .brand-accent {
    color: var(--tblr-primary);
}

.module-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pulse-text-faint);
    padding: 10px 16px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
}
.module-group-header--link {
    font-weight: 800;
    color: var(--pulse-text);
    transition: color 0.15s, background 0.15s;
}
.module-group-header--link:hover { color: var(--pulse-blue); background: #f8fafc; }
.module-group-header--link.active {
    color: var(--pulse-blue);
    background: rgba(46, 117, 182, 0.10);
    box-shadow: inset 3px 0 0 var(--pulse-blue);
}
.module-group-header .chevron { transition: transform .15s ease; }
.module-group-header.collapsed .chevron { transform: rotate(-90deg); }

.nav-subheader {
    list-style: none;
    padding: 10px 14px 2px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pulse-text-faint, #64748b);
    opacity: 0.7;
}

.navbar-vertical .navbar-nav .nav-link {
    min-height: 34px;
    padding: 5px 14px;
    color: var(--pulse-text);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.navbar-vertical .navbar-nav .nav-link-icon {
    flex: 0 0 auto;
    width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--pulse-text-muted);
}
.navbar-vertical .navbar-nav .nav-link .pulse-nav-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.navbar-vertical .navbar-nav .nav-link .pulse-nav-suffix {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}
.navbar-vertical .navbar-nav .nav-link:hover {
    color: var(--pulse-blue);
    background: #f8fafc;
}
.navbar-vertical .navbar-nav .nav-link:hover .nav-link-icon {
    color: var(--pulse-blue);
}
.navbar-vertical .navbar-nav .nav-item.active > .nav-link {
    color: var(--pulse-blue);
    background: rgba(46, 117, 182, 0.10);
    box-shadow: inset 3px 0 0 var(--pulse-blue);
}
.navbar-vertical .navbar-nav .nav-item.active > .nav-link .nav-link-icon {
    color: var(--pulse-blue);
}

/* Sidebar badge — NEW / BETA / PRO / count — tight pill, fits on the
 * right of the nav link without overflowing the sidebar edge. */
.pulse-sidebar-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.4;
    white-space: nowrap;
}
.pulse-sidebar-badge--new {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.35);
}
.pulse-sidebar-badge--alert {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.4);
    font-size: 10px;
    padding: 1px 7px;
    min-width: 22px;
    text-align: center;
}

.nav-item.locked .nav-link { opacity: 0.45; cursor: pointer; }
.nav-item.locked .lock-icon { margin-left: auto; opacity: 0.7; }

.badge-grade {
    width: 20px;
    height: 20px;
    line-height: 16px;
    border-radius: 50%;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    border: 2px solid currentColor;
    background: transparent;
    display: inline-block;
    flex-shrink: 0;
}
.badge-grade.green  { color: var(--pulse-green); }
.badge-grade.orange { color: var(--pulse-orange); }
.badge-grade.red    { color: var(--pulse-red); }

/* ============================================================ */
/* 4. Top-bar chrome + trial banner                              */
/* ============================================================ */

.pulse-topbar {
    background: #fff;
    border-bottom: 1px solid var(--pulse-border);
    min-height: 48px;
}
.pulse-topbar__inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    min-height: 48px;
    padding-top: 4px;
    padding-bottom: 4px;
    max-width: 100% !important;
    padding-left: 16px;
    padding-right: 16px;
}
.min-width-0 {
    min-width: 0;
}
.pulse-topbar__breadcrumb {
    flex: 1 1 0%;
    min-width: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
    background: transparent;
}
.pulse-topbar__breadcrumb .breadcrumb-item {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pulse-topbar__right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.pulse-topbar__right > * {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
}
.pulse-topbar .dropdown-menu {
    min-width: 220px;
    font-size: 13px;
}

.stale-pill {
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.live-pill {
    background: #d1fae5;
    color: #065f46;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.live-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pulse-green);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.trial-banner {
    background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
    padding: 10px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.trial-banner strong { color: #78350f; }
.trial-banner a {
    color: var(--tblr-primary-darker);
    font-weight: 600;
    text-decoration: underline;
}

/* ============================================================ */
/* 5. Pulse KPI tile                                             */
/* ============================================================ */

.pulse-kpi-tile {
    border: 1px solid var(--pulse-border);
    border-radius: var(--pulse-card-radius);
    background: #fff;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
    height: 100%;
}
.pulse-kpi-tile:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
.pulse-kpi-tile .card-body { padding: 18px 14px 16px; }

.pulse-kpi-tile__icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}
.pulse-kpi-tile__icon-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid currentColor;
    background: #fff;
}
.pulse-kpi-tile--green   .pulse-kpi-tile__icon-ring { color: var(--pulse-green); }
.pulse-kpi-tile--orange  .pulse-kpi-tile__icon-ring { color: var(--pulse-orange); }
.pulse-kpi-tile--red     .pulse-kpi-tile__icon-ring { color: var(--pulse-red); }
.pulse-kpi-tile--blue    .pulse-kpi-tile__icon-ring { color: var(--pulse-cyan); }
.pulse-kpi-tile--purple  .pulse-kpi-tile__icon-ring { color: var(--pulse-purple); }
.pulse-kpi-tile--primary .pulse-kpi-tile__icon-ring { color: var(--pulse-blue); }

.pulse-kpi-tile__value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 10px;
    color: var(--pulse-text);
    white-space: nowrap;
}
.pulse-kpi-tile--green  .pulse-kpi-tile__value { color: var(--pulse-green); }
.pulse-kpi-tile--orange .pulse-kpi-tile__value { color: var(--pulse-orange); }
.pulse-kpi-tile--red    .pulse-kpi-tile__value { color: var(--pulse-red); }
.pulse-kpi-tile__suffix {
    font-size: 16px;
    font-weight: 600;
    color: var(--pulse-text-muted);
}

.pulse-kpi-tile__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pulse-text-muted);
    margin-top: 4px;
    line-height: 1.3;
}
.pulse-kpi-tile__sublabel {
    font-size: 12px;
    color: var(--pulse-text-faint);
    margin-top: 2px;
}

/* ============================================================ */
/* 6. Pulse score badge                                          */
/* ============================================================ */

.pulse-score-badge__ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 6px solid currentColor;
    background: #fff;
    flex-shrink: 0;
}
.pulse-score-badge--sm .pulse-score-badge__ring { width: 72px;  height: 72px; }
.pulse-score-badge--md .pulse-score-badge__ring { width: 100px; height: 100px; }
.pulse-score-badge--lg .pulse-score-badge__ring { width: 130px; height: 130px; }
.pulse-score-badge__ring--green  { color: var(--pulse-green); }
.pulse-score-badge__ring--orange { color: var(--pulse-orange); }
.pulse-score-badge__ring--red    { color: var(--pulse-red); }

.pulse-score-badge__value {
    font-weight: 800;
    font-size: 26px;
    color: var(--pulse-text);
}
.pulse-score-badge--sm .pulse-score-badge__value { font-size: 20px; }
.pulse-score-badge--lg .pulse-score-badge__value { font-size: 32px; }

.pulse-score-badge__label {
    font-size: 16px;
    font-weight: 700;
    color: var(--pulse-text);
}
.pulse-score-badge__sublabel {
    font-size: 13px;
    color: var(--pulse-text-muted);
    margin-top: 2px;
}

/* Post-Audit-2 PR-D — stale-state suppression. The audit caught
   "FLEET HEALTH 100/A" tiles celebrating green on 13h-old snapshots
   while the page chip said STALE. Tiles flagged ``dimmed=true`` by
   their caller drop value contrast to ~0.4 and surface a small "Stale"
   chip below the sublabel so the reader sees the same state across
   page chrome and tile body. Q-D.2 = A: dim, don't replace, so the
   tile keeps its layout. */
.pulse-kpi-tile--dimmed .pulse-kpi-tile__value,
.pulse-kpi-tile--dimmed .pulse-kpi-tile__icon-ring,
.pulse-kpi-tile--dimmed .pulse-kpi-tile__label,
.pulse-kpi-tile--dimmed .pulse-kpi-tile__sublabel {
    opacity: 0.4;
}
.pulse-kpi-tile__stale-chip,
.pulse-score-badge__stale-chip {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff4e6;
    border: 1px solid #ffd8a8;
    color: #8a5800;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pulse-score-badge--dimmed .pulse-score-badge__ring,
.pulse-score-badge--dimmed .pulse-score-badge__value,
.pulse-score-badge--dimmed .pulse-score-badge__label,
.pulse-score-badge--dimmed .pulse-score-badge__sublabel {
    opacity: 0.4;
}

/* ============================================================ */
/* 7. Pulse page header                                          */
/* ============================================================ */

.pulse-page-header__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--pulse-text);
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}
.pulse-page-header__subtitle {
    font-size: 14px;
    color: var(--pulse-text-muted);
}

.pulse-tier-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(46, 117, 182, 0.1);
    color: var(--pulse-blue);
    vertical-align: middle;
}
.pulse-tier-badge--managed {
    background: rgba(139, 92, 246, 0.1);
    color: var(--pulse-purple);
}
.pulse-tier-badge--free {
    background: rgba(100, 116, 139, 0.1);
    color: var(--pulse-text-muted);
}

/* ============================================================ */
/* 8. Pulse row / list row                                       */
/* ============================================================ */

.pulse-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 8px;
    transition: background .12s ease;
}
.pulse-row:hover { background: #f8fafc; }
.pulse-row + .pulse-row { border-top: 1px solid var(--pulse-border-subtle); }

.pulse-row--hq {
    background: #f0f9ff;
    border-left: 3px solid var(--pulse-blue);
    padding: 14px 16px;
}
.pulse-row--warn     { background: #fffbeb; }
.pulse-row--critical { background: #fef2f2; }

.pulse-row__name {
    font-weight: 500;
    color: #334155;
}
.pulse-row__meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pulse-row__latency {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}

/* Back-compat aliases for older templates. */
.store-row        { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 6px; }
.store-row:hover  { background: #f8fafc; }
.store-row .store-name { font-weight: 500; color: #334155; }
.store-row .store-meta { display: flex; align-items: center; gap: 12px; }
.latency-pill     { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #f1f5f9; color: #475569; }

/* ============================================================ */
/* 9. Status dots + severity pills                               */
/* ============================================================ */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.online   { background: var(--pulse-green); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.status-dot.degraded { background: var(--pulse-orange); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.status-dot.offline  { background: var(--pulse-red); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }

.pulse-severity-pill {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pulse-severity-pill--critical { background: #fef2f2; color: #b91c1c; }
.pulse-severity-pill--warning  { background: #fffbeb; color: #b45309; }
.pulse-severity-pill--info     { background: #eff6ff; color: #1d4ed8; }
.pulse-severity-pill--success  { background: #f0fdf4; color: #15803d; }

.table tr.pulse-row-warn     td { background: #fffbeb; }
.table tr.pulse-row-critical td { background: #fef2f2; }

.pulse-sparkline {
    width: 80px;
    height: 22px;
    display: inline-block;
}

/* ============================================================ */
/* 10. Responsive rules — phone + tablet                         */
/* ============================================================ */

/* Marketing nav — mobile drawer */
@media (max-width: 991.98px) {
    /* Drawer slides in below the sticky nav bar */
    .marketing-nav .navbar-collapse {
        background: rgba(15, 26, 46, 0.98);
        border-top: 1px solid rgba(255,255,255,0.08);
        padding: 0.5rem 1rem 1rem;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }
    /* Nav links — full-width tap targets */
    .marketing-nav .nav-link {
        padding: 0.75rem 0.25rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        font-size: 15px !important;
    }
    /* Dropdowns open inline (accordion style) */
    .marketing-nav .dropdown-menu {
        position: static !important;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 0.5rem 1rem;
    }
    .marketing-nav .dropdown-item {
        color: #8899aa !important;
        padding: 0.5rem 0.25rem;
        font-size: 14px;
    }
    .marketing-nav .dropdown-item:hover,
    .marketing-nav .dropdown-item:focus {
        color: #fff !important;
        background: transparent;
    }
    .marketing-nav .dropdown-divider { border-color: rgba(255,255,255,0.06); }
    .marketing-nav .dropdown-header { color: #4da3ff; font-size: 11px; padding-left: 0.25rem; }
    /* Remove the ms-auto so items span full width on mobile */
    .marketing-nav .navbar-nav.ms-auto { margin-left: 0 !important; }
}

/* Marketing hero — reduce padding + clamp heading on small screens */
@media (max-width: 575.98px) {
    .marketing-hero { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .marketing-hero .container-xl { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .marketing-hero h1 { font-size: 1.75rem !important; line-height: 1.2 !important; }
    .marketing-hero .lead { font-size: 1rem; }
}

@media (max-width: 991.98px) {
    .pulse-page-header__title { font-size: 22px; }
    .pulse-kpi-tile__value { font-size: 24px; }
    .pulse-kpi-tile__icon-ring {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .card-body { padding: 16px; }
}

@media (max-width: 767.98px) {
    .pulse-page-header__title { font-size: 19px; }
    .pulse-page-header__subtitle { font-size: 13px; }

    .pulse-kpi-tile .card-body { padding: 14px 10px; }
    .pulse-kpi-tile__value { font-size: 22px; }
    .pulse-kpi-tile__suffix { font-size: 13px; }
    .pulse-kpi-tile__label { font-size: 10px; }
    .pulse-kpi-tile__sublabel { font-size: 11px; }

    .pulse-score-badge--md .pulse-score-badge__ring {
        width: 80px;
        height: 80px;
    }
    .pulse-score-badge--md .pulse-score-badge__value { font-size: 20px; }

    .card-header { padding: 12px 14px; }
    .card-header .card-title { font-size: 14px; }
    .card-body { padding: 14px; }

    .page-body { padding-top: 0.5rem; }

    .pulse-row { padding: 10px 12px; }
    .pulse-row__meta { gap: 8px; }

    /* Tables → stacked cards on phone. Opt-in via .pulse-table-stack. */
    .pulse-table-stack thead { display: none; }
    .pulse-table-stack tbody tr {
        display: block;
        padding: 10px 12px;
        border: 1px solid var(--pulse-border);
        border-radius: 8px;
        margin-bottom: 8px;
        background: #fff;
    }
    .pulse-table-stack tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0 !important;
        border: 0 !important;
    }
    .pulse-table-stack tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--pulse-text-muted);
        letter-spacing: 0.04em;
    }

    .footer .row > div { flex: 1 1 100%; text-align: center; }
}

/* ============================================================ */
/* 11. Tap target + accessibility                                */
/* ============================================================ */

.btn, .nav-link, .dropdown-item { min-height: 40px; }

@media (max-width: 767.98px) {
    .btn, .nav-link, .dropdown-item { min-height: 44px; } /* Apple HIG */
    .btn-sm { min-height: 36px; }
}

[x-cloak] { display: none !important; }

.d-phone-none { }
@media (max-width: 767.98px) {
    .d-phone-none { display: none !important; }
}

/* ============================================================ */
/* 12. Detail Panel (Zoom 3 drill-down)                          */
/* ============================================================ */

.detail-panel-container { position: relative; z-index: 1050; }

.detail-panel-backdrop {
    position: fixed; inset: 0;
    background: rgba(24, 36, 51, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1050;
}

.detail-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(520px, 90vw);
    background: var(--tblr-bg-surface);
    border-left: 1px solid var(--tblr-border-color);
    box-shadow: -8px 0 30px rgba(0,0,0,0.12);
    z-index: 1051;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.detail-panel-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; cursor: pointer;
    color: var(--tblr-secondary); font-size: 20px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: background 0.15s;
}
.detail-panel-close:hover { background: var(--tblr-bg-surface-secondary); }

.detail-panel-body { padding: 24px; }
.detail-panel-body h4 { margin-bottom: 4px; }
.detail-panel-body .panel-subtitle {
    color: var(--tblr-secondary); font-size: 13px; margin-bottom: 20px;
}

.detail-panel-body .panel-section {
    border-top: 1px solid var(--tblr-border-color);
    padding-top: 16px; margin-top: 16px;
}
.detail-panel-body .panel-section-title {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--tblr-secondary); margin-bottom: 10px;
}

.detail-panel-enter { transition: transform 0.25s ease-out; }
.detail-panel-enter-start { transform: translateX(100%); }
.detail-panel-enter-end { transform: translateX(0); }
.detail-panel-leave { transition: transform 0.2s ease-in; }
.detail-panel-leave-start { transform: translateX(0); }
.detail-panel-leave-end { transform: translateX(100%); }

/* ============================================================ */
/* 13. Region Group (collapsible store grouping)                 */
/* ============================================================ */

.region-group-header {
    border-radius: 6px !important;
    font-size: 12px;
}
.region-group-header:hover {
    background: var(--tblr-bg-surface-secondary) !important;
}
.region-group .table { margin-bottom: 0; }
.region-group .table td { font-size: 13px; padding: 8px 12px; }

/* ============================================================ */
/* 14. Attention Items (Command Center)                          */
/* ============================================================ */

.attention-item {
    padding: 10px 16px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--tblr-border-color);
    cursor: pointer;
    transition: background 0.15s;
}
.attention-item:hover { background: var(--tblr-bg-surface-secondary); }
.attention-item:last-child { border-bottom: none; }
.attention-item.severity-critical { border-left-color: var(--tblr-red); }
.attention-item.severity-warning { border-left-color: var(--tblr-yellow); }
.attention-item.severity-info { border-left-color: var(--tblr-azure); }

.attention-item .attention-title {
    font-weight: 600; font-size: 14px; margin-bottom: 4px;
}
.attention-item .attention-impact {
    font-size: 13px; color: var(--tblr-secondary); margin-bottom: 4px;
}
.attention-item .attention-actions { display: flex; gap: 8px; }

/* ============================================================ */
/* 15. Status dots and severity in tables                        */
/* ============================================================ */

.status-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: 6px; vertical-align: middle;
}
.status-dot.online, .status-dot.synced { background: var(--tblr-green); }
.status-dot.behind { background: var(--tblr-yellow); }
.status-dot.offline { background: var(--tblr-red); }
.status-dot.degraded { background: var(--tblr-orange); }

.store-row-clickable { cursor: pointer; transition: background 0.1s; }
.store-row-clickable:hover { background: var(--tblr-bg-surface-secondary) !important; }

/* ============================================================ */
/* 16. Forecast / capacity bars                                  */
/* ============================================================ */

.capacity-bar {
    height: 6px; border-radius: 3px; background: var(--tblr-border-color);
    overflow: hidden;
}
.capacity-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.capacity-bar-fill.safe { background: var(--tblr-green); }
.capacity-bar-fill.monitor { background: var(--tblr-yellow); }
.capacity-bar-fill.danger { background: var(--tblr-red); }

/* ============================================================ */
/* 17. Business impact banner                                    */
/* ============================================================ */

.impact-banner {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 8px;
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 13px;
}
.impact-banner.impact-high {
    background: rgba(var(--tblr-red-rgb), 0.08);
    border: 1px solid rgba(var(--tblr-red-rgb), 0.2);
}
.impact-banner.impact-medium {
    background: rgba(var(--tblr-yellow-rgb), 0.08);
    border: 1px solid rgba(var(--tblr-yellow-rgb), 0.2);
}
.impact-banner.impact-low {
    background: rgba(var(--tblr-azure-rgb), 0.08);
    border: 1px solid rgba(var(--tblr-azure-rgb), 0.2);
}
.impact-banner .impact-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* ============================================================ */
/* 18. Explain-popover — global trigger + infobox               */
/*                                                               */
/* position:absolute — infobox stays with its icon, scrolls     */
/* with the page. font-size:1rem resets large parent contexts   */
/* (grade circles use 56px). z-index:9000 clears tile stacking. */
/* No JavaScript coordinate calculation needed.                  */
/* ============================================================ */

/* Wrapper — the positioning anchor for the infobox */
.explain-popover-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Infobox — opens directly below its icon, scrolls with page */
.explain-popover-body {
    position: absolute;
    top: 1.75rem;
    left: 0;
    z-index: 9000;
    font-size: 1rem;
    font-weight: normal;    /* reset: grade circle .num has font-weight:700 */
    line-height: 1.5;
    color: var(--tblr-body-color, #1e293b); /* reset: kpi-label may be grey */
    min-width: 280px;
    max-width: 340px;
    white-space: normal;
    text-transform: none;
    letter-spacing: normal;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .14));
}

/* ⓘ trigger button — no browser default styling, plain icon */
/* appearance:none removes the default browser button rectangle */
.explain-popover-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    -webkit-appearance: none;
    appearance: none;
    padding: 0 .15rem;
    cursor: pointer;
    color: inherit;
    opacity: .55;
    transition: opacity .15s;
    line-height: 1;
    vertical-align: middle;
    font-size: 1.1rem;
}
.explain-popover-badge:hover,
.explain-popover-badge:focus-visible { opacity: 1; outline: none; }

/* Fleet canvas — ⓘ label row: label text + badge as siblings (not nested)   */
/* Prevents opacity:0.4 stale-tile rule from dimming the infobox               */
.fleet-canvas .kpi-label-row {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
}

/* Command Center tiles — chip above stretched-link ::after (z-index:1) */
.hero-tile { position: relative; }
/* explain-chip-wrap: wrapper for button + dropdown (div-inside-button invalid) */
.hero-tile .explain-chip-wrap {
    position: relative;
    z-index: 2;
    margin-left: auto;
}
.hero-tile .explain-chip {
    background: transparent;
    border: none;
    padding: .1rem .25rem;
    cursor: pointer;
    font-size: 15px;
    color: #adb5bd;
    line-height: 1;
}
.hero-tile .explain-chip:hover { color: #6c757d; }
/* CC chip dropdown — pure CSS, no JS coordinates */
.hero-tile .explain-chip-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    z-index: 9000;
    width: 240px;
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: .6rem .75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
.impact-banner .impact-content strong { display: block; margin-bottom: 2px; }

/* ============================================================ */
/* 19. Help trigger button — global (pages outside fleet-canvas) */
/* fleet_canvas.css scopes to .fleet-canvas; this covers all    */
/* other pages (replication, diagnostics, etc.)                  */
/* ============================================================ */
.btn-help {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: .3rem .75rem;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    -webkit-appearance: none;
    appearance: none;
}
.btn-help:hover { border-color: #0d6efd; color: #0d6efd; }
