/* ═══════════════════════════════════════════════
   Hubia Tenant Theme — CSS custom properties
   Defaults = BuzZync brand palette.
   Overridden at runtime by TenantThemeService.ApplyThemeAsync()
   via hubiaTheme.apply() (js/theme-interop.js).
   ═══════════════════════════════════════════════ */

:root {
    /* Solid colors — overridden at runtime by hubiaTheme.apply() */
    --hubia-primary:      #7A54A2;  /* BuzZync purple */
    --hubia-secondary:    #263779;  /* Everlay blue   */
    --hubia-accent:       #1F1F4F;  /* Zorya navy     */
    --hubia-primary-dark: #5e3d7a;
    --hubia-accent-dark:  #13133a;
    --hubia-font:         Poppins;

    /* Alpha variants — CSS can't do rgba(var(--color)) directly */
    --hubia-primary-a10:  rgba(122, 84, 162, 0.10);
    --hubia-primary-a20:  rgba(122, 84, 162, 0.20);
    --hubia-primary-a25:  rgba(122, 84, 162, 0.25);
    --hubia-primary-a40:  rgba(122, 84, 162, 0.40);
}

/* ═══════════════════════════════════════════════
   Shared page styles — used by all standalone pages
   (Connectors, Users, Catalogs, Exports, Schedules, Settings)
   ═══════════════════════════════════════════════ */

/* ──── Page shell ──── */

.page-shell {
    max-width: 1420px;
    margin: 0 auto;
    padding: 1rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.page-header__title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.page-header__sub {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

/* ──── Card ──── */

.card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 1rem 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.card__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
}

.card__desc {
    margin: 0.25rem 0 0;
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 400;
    max-width: 480px;
    line-height: 1.4;
}

/* ──── KPI strip ──── */

.rw-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: stretch;
}

.rw-kpi {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-left: 4px solid;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-height: 88px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rw-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.rw-kpi--teal  { border-left-color: #0d9488; background: linear-gradient(135deg, #f0fdfa 0%, #e6f7f5 100%); }
.rw-kpi--amber { border-left-color: #d97706; background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }
.rw-kpi--blue  { border-left-color: #2563eb; background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.rw-kpi--violet { border-left-color: #7c3aed; background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); }

.rw-kpi__label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
}

.rw-kpi__value {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #0f172a;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rw-kpi__meta {
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 500;
}

/* ──── Tables ──── */

.page-shell table {
    width: 100%;
    border-collapse: collapse;
}

.page-shell thead th {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 0.55rem 0.7rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.page-shell tbody td {
    font-size: 0.82rem;
    color: #1e293b;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.page-shell tbody tr:hover td {
    background: #f0f4ff;
    color: #0f172a;
}

.page-shell tfoot td {
    font-size: 0.82rem;
    padding: 0.6rem 0.7rem;
    border-top: 2px solid #e2e8f0;
    background: #f8fafc;
}

.text-right {
    text-align: right;
}

/* ──── Edit row ──── */

.edit-row {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px dashed #93c5fd;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    transition: background 0.2s ease;
}

/* ──── Row states ──── */

.row--disabled td { opacity: 0.45; }
.row--warning td { background: #fffbeb; }
.row--warning:hover td { background: #fef3c7 !important; }
.row--auto td { opacity: 0.7; }
.row--selected td { background: #e0e7ff !important; }
.row--selected:hover td { background: #c7d2fe !important; }
.row--expanded td { background: #f0fdf4 !important; border-bottom: none; }
.row--detail td { border-bottom: 2px solid #0d9488 !important; }

/* ──── Provider groups (expandable) ──── */

.provider-group {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.provider-group:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.provider-group--expanded {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

button.provider-group__header,
.provider-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    transition: background 0.15s ease;
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
}

.provider-group__header:hover {
    background: #f8fafc;
}

.provider-group__body {
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid #f1f5f9;
}

/* ──── Sortable column headers ──── */

.th-sort {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.th-sort:hover {
    color: #2563eb;
    background: #f0f4ff;
}

/* ──── Catalog tabs ──── */

.cat-tabs {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cat-tab-body {
    padding: 1rem;
}

/* ──── Scrollable containers ──── */

.page-shell [style*="overflow-y:auto"],
.page-shell [style*="overflow-y: auto"] {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.page-shell [style*="overflow-y:auto"]::-webkit-scrollbar,
.page-shell [style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 6px;
}

.page-shell [style*="overflow-y:auto"]::-webkit-scrollbar-thumb,
.page-shell [style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.page-shell [style*="overflow-y:auto"]::-webkit-scrollbar-track,
.page-shell [style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: transparent;
}

/* ──── Responsive ──── */

@media (max-width: 1024px) {
    .rw-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rw-kpis {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .edit-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════════
   Users & Companies — Premium UX
   ═══════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes usrFadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes usrRowFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes usrPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@keyframes usrSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes usrCountFade {
    from { opacity: 0.3; }
    to   { opacity: 1; }
}

/* ── Tab content fade-in ── */
.cat-tab-body {
    animation: usrFadeSlideIn 0.3s ease-out;
}

/* ── Expansion panel slide ── */
.cat-tab-body .mud-expand-panel-content {
    animation: usrSlideDown 0.25s ease-out;
}

/* ── 5-col KPI grid ── */
.rw-kpis--5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 1200px) { .rw-kpis--5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .rw-kpis--5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .rw-kpis--5 { grid-template-columns: 1fr; } }

.rw-kpi--brand { border-top-color: #7A54A2; }

/* ── Skeleton ── */
.kpi-skeleton {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border-top: 3px solid #e5e7eb;
    background: #fafbfc;
}

/* ── Stats bar ── */
.usr-stats-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.usr-stat {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    letter-spacing: 0.02em;
}
.usr-stat--teal   { background: #f0fdfa; color: #0d9488; }
.usr-stat--blue   { background: #eff6ff; color: #2563eb; }
.usr-stat--amber  { background: #fffbeb; color: #d97706; }
.usr-stat--violet { background: #f5f3ff; color: #7c3aed; }
.usr-stat--green  { background: #f0fdf4; color: #059669; }
.usr-stat--red    { background: #fef2f2; color: #dc2626; }

/* ── Top companies cards ── */
.usr-top-companies {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0.5rem 0 0.75rem;
    scrollbar-width: none;
}
.usr-top-companies::-webkit-scrollbar { display: none; }
.usr-company-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 160px;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 150ms ease, box-shadow 150ms ease;
    flex-shrink: 0;
    cursor: default;
}
.usr-company-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.usr-company-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: #fff;
    flex-shrink: 0;
}
.usr-company-card--amber .usr-company-card__avatar { background: linear-gradient(135deg, #d97706, #f59e0b); }
.usr-company-card--blue .usr-company-card__avatar  { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.usr-company-card--teal .usr-company-card__avatar  { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.usr-company-card__name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    display: block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.usr-company-card__count {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
}

/* ── Panel headers ── */
.usr-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    font-size: 0.85rem;
}
.usr-panel-header__left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.usr-panel-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.6rem;
    color: #fff;
    flex-shrink: 0;
}
.usr-panel-avatar--amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.usr-panel-avatar--blue  { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.usr-panel-avatar--teal  { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.usr-panel-header__name { font-size: 0.82rem; font-weight: 700; color: #0f172a; }
.usr-panel-header__chips { display: flex; gap: 0.25rem; align-items: center; margin-top: 0.1rem; }
.usr-panel-bar {
    width: 60px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.usr-panel-bar__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}
.usr-panel-bar__fill--blue  { background: #2563eb; }
.usr-panel-bar__fill--amber { background: #d97706; }
.usr-panel-bar__fill--teal  { background: #0d9488; }

/* ── Table row animations ── */
.usr-animated-table tbody tr {
    animation: usrRowFadeIn 0.25s ease-out both;
    border-left: 3px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.usr-animated-table tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.usr-animated-table tbody tr:nth-child(2)  { animation-delay: 0.04s; }
.usr-animated-table tbody tr:nth-child(3)  { animation-delay: 0.06s; }
.usr-animated-table tbody tr:nth-child(4)  { animation-delay: 0.08s; }
.usr-animated-table tbody tr:nth-child(5)  { animation-delay: 0.10s; }
.usr-animated-table tbody tr:nth-child(6)  { animation-delay: 0.12s; }
.usr-animated-table tbody tr:nth-child(7)  { animation-delay: 0.14s; }
.usr-animated-table tbody tr:nth-child(8)  { animation-delay: 0.16s; }
.usr-animated-table tbody tr:nth-child(9)  { animation-delay: 0.18s; }
.usr-animated-table tbody tr:nth-child(10) { animation-delay: 0.20s; }
.usr-animated-table tbody tr:hover { border-left-color: #2563eb; }
.usr-animated-table tbody tr.row--warning:hover { border-left-color: #d97706; }

/* ── Search result badge ── */
.usr-result-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.usr-result-badge--filtered {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
    animation: usrPulse 0.3s ease;
}

/* ── Severity badges ── */
.usr-severity {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.usr-severity--high   { background: #fef2f2; color: #dc2626; }
.usr-severity--medium { background: #fffbeb; color: #d97706; }
.usr-severity--low    { background: #f0fdf4; color: #059669; }

/* ── Guide step cards ── */
.usr-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.usr-step-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    border-top: 3px solid var(--step-color, #64748b);
    position: relative;
    transition: transform 150ms ease, box-shadow 150ms ease;
}
.usr-step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.usr-step-card__num {
    position: absolute;
    top: -10px;
    left: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--step-color, #64748b);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.usr-step-card__title {
    font-weight: 700;
    color: var(--step-color, #334155);
    margin: 0.35rem 0 0.25rem;
    font-size: 0.82rem;
}
.usr-step-card__desc {
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
}

/* ── Animated KPI counter ── */
.rw-kpi__value[data-target] {
    animation: usrCountFade 0.6s ease-out;
}

/* ── Bulk action bar ── */
.usr-bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    background: #eff6ff;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
}

/* ═══ Company Matcher ═══ */
.usr-matcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
}
@media (max-width: 900px) { .usr-matcher { grid-template-columns: 1fr; } }
.usr-matcher-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}
.usr-matcher-panel__title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.usr-matcher-panel--bz { border-top: 3px solid #2563eb; }
.usr-matcher-panel--bz .usr-matcher-panel__title { color: #2563eb; }
.usr-matcher-panel--emg { border-top: 3px solid #d97706; }
.usr-matcher-panel--emg .usr-matcher-panel__title { color: #d97706; }
.usr-matcher-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.78rem;
    animation: usrRowFadeIn 0.2s ease-out both;
}
.usr-matcher-row:last-child { border-bottom: none; }
.usr-matcher-row__name {
    font-weight: 700;
    color: #0f172a;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.usr-matcher-row__count {
    font-size: 0.65rem;
    color: #64748b;
    white-space: nowrap;
}
.usr-link-badge {
    font-size: 0.58rem;
    font-weight: 800;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.usr-link-badge--linked {
    background: #f0fdf4;
    color: #059669;
}
.usr-link-badge--unlinked {
    background: #fef2f2;
    color: #dc2626;
}

/* ═══════════════════════════════════════════
   Connectors & Providers — Premium UX
   ═══════════════════════════════════════════ */

/* ── Stats bar (reuses usr pattern) ── */
.cnx-stats-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.cnx-stat {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    letter-spacing: 0.02em;
}
.cnx-stat--teal   { background: #f0fdfa; color: #0d9488; }
.cnx-stat--blue   { background: #eff6ff; color: #2563eb; }
.cnx-stat--amber  { background: #fffbeb; color: #d97706; }
.cnx-stat--violet { background: #f5f3ff; color: #7c3aed; }
.cnx-stat--green  { background: #f0fdf4; color: #059669; }
.cnx-stat--red    { background: #fef2f2; color: #dc2626; }

/* ── Animated table ── */
.cnx-animated-table tbody tr {
    animation: usrRowFadeIn 0.25s ease-out both;
    border-left: 3px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.cnx-animated-table tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.cnx-animated-table tbody tr:nth-child(2)  { animation-delay: 0.04s; }
.cnx-animated-table tbody tr:nth-child(3)  { animation-delay: 0.06s; }
.cnx-animated-table tbody tr:nth-child(4)  { animation-delay: 0.08s; }
.cnx-animated-table tbody tr:nth-child(5)  { animation-delay: 0.10s; }
.cnx-animated-table tbody tr:nth-child(6)  { animation-delay: 0.12s; }
.cnx-animated-table tbody tr:nth-child(7)  { animation-delay: 0.14s; }
.cnx-animated-table tbody tr:nth-child(8)  { animation-delay: 0.16s; }
.cnx-animated-table tbody tr:nth-child(9)  { animation-delay: 0.18s; }
.cnx-animated-table tbody tr:nth-child(10) { animation-delay: 0.20s; }
.cnx-animated-table tbody tr:hover { border-left-color: #0d9488; }
.cnx-animated-table tbody tr.row--warning:hover { border-left-color: #d97706; }

/* ── Result badge ── */
.cnx-result-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.cnx-result-badge--filtered {
    background: #f0fdfa;
    color: #0d9488;
    font-weight: 600;
    animation: usrPulse 0.3s ease;
}

/* ── Bulk action bar ── */
.cnx-bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    background: #f0fdfa;
    border-radius: 10px;
    border: 1px solid #99f6e4;
    animation: usrSlideDown 0.25s ease-out;
}

/* ── Top providers cards ── */
.cnx-top-providers {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0.5rem 0 0.75rem;
    scrollbar-width: none;
}
.cnx-top-providers::-webkit-scrollbar { display: none; }
.cnx-provider-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 160px;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 150ms ease, box-shadow 150ms ease;
    flex-shrink: 0;
    cursor: default;
}
.cnx-provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.cnx-provider-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
}
.cnx-provider-card__name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    display: block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cnx-provider-card__count {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
}

/* ── Matcher panels ── */
.cnx-matcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
}
@media (max-width: 900px) { .cnx-matcher { grid-template-columns: 1fr; } }
.cnx-matcher-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}
.cnx-matcher-panel__title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.cnx-matcher-panel--unmapped { border-top: 3px solid #d97706; }
.cnx-matcher-panel--unmapped .cnx-matcher-panel__title { color: #d97706; }
.cnx-matcher-panel--providers { border-top: 3px solid #0d9488; }
.cnx-matcher-panel--providers .cnx-matcher-panel__title { color: #0d9488; }
.cnx-matcher-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.78rem;
    animation: usrRowFadeIn 0.2s ease-out both;
}
.cnx-matcher-row:last-child { border-bottom: none; }
.cnx-matcher-row__name {
    font-weight: 700;
    color: #0f172a;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cnx-matcher-row__note {
    font-size: 0.65rem;
    color: #64748b;
    white-space: nowrap;
}

/* ── 6-col KPI grid ── */
.cnx-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 1200px) { .cnx-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .cnx-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .cnx-kpi-grid { grid-template-columns: 1fr; } }

.rw-kpi--green { border-top-color: #059669; }

/* ── Carrier chip (color via CSS custom property) ── */
.cnx-carrier-chip {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: hsl(var(--carrier-hue, 210), 90%, 95%);
    color: hsl(var(--carrier-hue, 210), 50%, 35%);
    border: 1px solid hsl(var(--carrier-hue, 210), 60%, 85%);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ── Carrier distribution bars ── */
.cnx-carrier-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.cnx-carrier-bar {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}
.cnx-carrier-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════
   Account Tags
   ═══════════════════════════════════════════ */

.usr-tag-chip {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.42rem;
    border-radius: 5px;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════
   Users — Hierarchy Tree & Detail Panel
   ═══════════════════════════════════════════ */

/* ── Tree badges (compact counters inside tree nodes) ── */
.tree-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    font-size: 0.55rem;
    font-weight: 800;
    border-radius: 4px;
    padding: 0 3px;
    letter-spacing: 0.02em;
}
.tree-badge--blue  { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.tree-badge--amber { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.tree-badge--teal  { background: #f0fdfa; color: #0d9488; border: 1px solid #99f6e4; }

/* ── Tree status dots (tiny circles for user integration status) ── */
.tree-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tree-dot--blue  { background: #2563eb; }
.tree-dot--amber { background: #d97706; }
.tree-dot--teal  { background: #0d9488; }
.tree-dot--red   { background: #dc2626; }
.tree-dot--green { background: #059669; }

/* ── Selected tree node highlight ── */
.tree-node--selected {
    background: #eff6ff;
    border-radius: 4px;
    padding: 1px 4px;
    margin: -1px -4px;
}

/* ── User detail avatar ── */
.usr-detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Detail sections ── */
.usr-detail-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.usr-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.usr-detail-section__title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 0.65rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.usr-detail-section__subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

/* ── Detail field grid ── */
.usr-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem;
}
.usr-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.usr-detail-field__label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}
.usr-detail-field__value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

/* ── Integration status chips ── */
.intg-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    min-width: 140px;
    flex: 1;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.intg-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.intg-chip--green {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-color: #bbf7d0;
}
.intg-chip--green .mud-icon-root { color: #059669; }
.intg-chip--gray {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.intg-chip--gray .mud-icon-root { color: #94a3b8; }
.intg-chip--amber {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
}
.intg-chip--amber .mud-icon-root { color: #d97706; }
.intg-chip__title {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f172a;
}
.intg-chip__detail {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 960px) {
    .usr-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .intg-chip {
        min-width: 120px;
    }
}


/* ═══════════════════════════════════════════
   Card entrance animations (card-animate)
   ═══════════════════════════════════════════ */

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-animate {
    animation: cardSlideUp 0.35s ease-out both;
}

/* Stagger for card grids (nth-child 1–12) */
.card-animate:nth-child(1)  { animation-delay: 0.04s; }
.card-animate:nth-child(2)  { animation-delay: 0.08s; }
.card-animate:nth-child(3)  { animation-delay: 0.12s; }
.card-animate:nth-child(4)  { animation-delay: 0.16s; }
.card-animate:nth-child(5)  { animation-delay: 0.20s; }
.card-animate:nth-child(6)  { animation-delay: 0.24s; }
.card-animate:nth-child(7)  { animation-delay: 0.28s; }
.card-animate:nth-child(8)  { animation-delay: 0.32s; }
.card-animate:nth-child(9)  { animation-delay: 0.36s; }
.card-animate:nth-child(10) { animation-delay: 0.40s; }
.card-animate:nth-child(11) { animation-delay: 0.44s; }
.card-animate:nth-child(12) { animation-delay: 0.48s; }

/* ═══════════════════════════════════════════
   Brief card hover (Briefs page)
   ═══════════════════════════════════════════ */

.brief-card {
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease !important;
}

.brief-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(122, 84, 162, 0.18) !important;
    border-color: rgba(122, 84, 162, 0.35) !important;
}

/* ═══════════════════════════════════════════
   Exports & Schedules — rw-card / rw-empty / rw-job / rw-table utilities
   ═══════════════════════════════════════════ */

/* rw-card (scoped component CSS defines .rw-card in RwCard.razor.css;
   these extend it for non-component usage in ExportsSchedules) */
section.rw-card {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 1rem;
    transition: box-shadow 150ms ease;
}

section.rw-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

section.rw-card .rw-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

section.rw-card .rw-card__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1F1F4F;
}

/* rw-empty (non-component version) */
.rw-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    border-radius: 10px;
    border: 1px dashed #e2e8f0;
    background: #fafbfc;
    color: #64748b;
    font-size: 0.82rem;
}

.rw-empty--sm {
    padding: 1.25rem 1rem;
    min-height: 100px;
    font-size: 0.78rem;
}

.rw-empty .mud-icon-root,
.rw-empty--sm .mud-icon-root {
    color: #cbd5e1;
    font-size: 1.6rem;
}

/* rw-job-grid — key/value grid for export status */
.rw-job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.65rem;
}

.rw-job-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.rw-job-item__label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
}

.rw-job-item__value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

/* rw-mono — monospaced value */
.rw-mono {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
}

/* rw-muted — muted text */
.rw-muted {
    color: #64748b;
}

/* rw-table — table inside rw-card */
.rw-table {
    font-size: 0.82rem;
}

.rw-table thead th {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 0.45rem 0.65rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    background: #fff;
}

.rw-table tbody td {
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
}

.rw-table tbody tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════════
   Settings — empty state upgrade
   ═══════════════════════════════════════════ */

.settings-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.83rem;
}

.settings-empty .mud-icon-root {
    font-size: 2.2rem;
    color: #cbd5e1;
    margin-bottom: 0.25rem;
}

/* ═══════════════════════════════════════════
   MudProgressLinear top-of-content loader
   ═══════════════════════════════════════════ */

.page-loader {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════
   Exports & Schedules — Sync tab additions
   ═══════════════════════════════════════════ */

/* Green KPI variant (used by Sync Status tab) */
.rw-kpi--green {
    border-left-color: var(--hubia-status-success, #10B981);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

/* MudTabs scoped overrides — transparent background */
.page-shell .mud-tabs-panels {
    background: transparent;
}

.page-shell .mud-tab-panel {
    padding-top: 1rem;
}

/* ═══════════════════════════════════════════
   Export Templates — designer layout
   ═══════════════════════════════════════════ */

/* Section label (Selected columns / Available columns) */
.et-section-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

/* Columns section wrapper */
.et-columns-section {
    padding: 0.5rem 0;
}

/* Selected column list — vertical stack */
.et-column-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.et-column-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.et-column-item:hover {
    background: #f0f4ff;
    border-color: #e0e7ff;
}

.et-column-item__left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.et-column-item__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.et-column-item__actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

/* Available columns grid — checkbox grid */
.et-available-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.25rem;
}

.et-available-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.et-available-item:hover {
    background: #f0f4ff;
}

.et-available-item--selected {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

/* Action bar — save, duplicate, delete */
.et-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

/* ── Gallery view ── */
.et-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.et-gallery-card {
    position: relative;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.et-gallery-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #c7d2fe;
    transform: translateY(-2px);
}

.et-gallery-card--selected {
    border-color: #7A54A2;
    box-shadow: 0 0 0 2px rgba(122,84,162,0.2);
}

.et-gallery-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.et-gallery-card__name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}

.et-gallery-card__preview {
    height: 90px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.et-gallery-card__preview-inner {
    display: flex;
    gap: 0.3rem;
    align-items: flex-end;
    padding: 0.5rem;
}

.et-gallery-card__preview-bar {
    width: 14px;
    border-radius: 3px 3px 0 0;
    background: #7A54A2;
    opacity: 0.6;
}

.et-gallery-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.et-gallery-card__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    color: #94a3b8;
}

.et-gallery-card__actions {
    display: flex;
    gap: 0.15rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.et-gallery-card:hover .et-gallery-card__actions {
    opacity: 1;
}

/* ── Section designer ── */
.et-section-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.et-section-item:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.et-section-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    user-select: none;
}

.et-section-item__header:hover {
    background: #f8fafc;
    border-radius: 10px 10px 0 0;
}

.et-section-item__left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.et-section-item__type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.et-section-item__body {
    padding: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

/* ── Chart type picker grid ── */
.et-chart-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.4rem;
}

.et-chart-picker__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.et-chart-picker__item:hover {
    border-color: #c7d2fe;
    background: #f0f4ff;
}

.et-chart-picker__item--selected {
    border-color: #7A54A2;
    background: #f5f0ff;
    box-shadow: 0 0 0 2px rgba(122,84,162,0.15);
}

.et-chart-picker__label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
}

/* ── Color palette selector ── */
.et-palette-row {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.et-palette-option {
    display: flex;
    gap: 2px;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.et-palette-option:hover {
    border-color: #c7d2fe;
}

.et-palette-option--selected {
    border-color: #7A54A2;
    box-shadow: 0 0 0 2px rgba(122,84,162,0.15);
}

.et-palette-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ── Sheet tabs bar ── */
.et-sheet-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0.75rem;
}

.et-sheet-tab {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.et-sheet-tab:hover {
    color: #7A54A2;
}

.et-sheet-tab--active {
    color: #7A54A2;
    border-bottom-color: #7A54A2;
    font-weight: 700;
}

.et-sheet-tab__close {
    font-size: 0.7rem;
    cursor: pointer;
    color: #94a3b8;
    padding: 1px 3px;
    border-radius: 4px;
}

.et-sheet-tab__close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.et-sheet-tab--add {
    color: #94a3b8;
    font-weight: 500;
    padding: 0.5rem 0.6rem;
}

.et-sheet-tab--add:hover {
    color: #7A54A2;
    background: #f5f0ff;
    border-radius: 6px 6px 0 0;
}

/* ── Preview mockup ── */
.et-preview-mockup {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.et-preview-mockup__toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.68rem;
    color: #94a3b8;
}

.et-preview-section {
    padding: 0.75rem;
    border-bottom: 1px dashed #e5e7eb;
}

.et-preview-section:last-child {
    border-bottom: none;
}

.et-preview-section__label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

/* ── KPI preview cards ── */
.et-kpi-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.et-kpi-preview-card {
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f5f0ff 0%, #eff6ff 100%);
    border: 1px solid #e0e7ff;
    text-align: center;
}

.et-kpi-preview-card__value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #7A54A2;
    line-height: 1.1;
}

.et-kpi-preview-card__label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 0.15rem;
}

/* ── View toggle ── */
.et-view-toggle {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.et-view-toggle__btn {
    padding: 4px 10px;
    font-size: 0.7rem;
    cursor: pointer;
    background: #fff;
    border: none;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.et-view-toggle__btn:hover {
    background: #f0f4ff;
}

.et-view-toggle__btn--active {
    background: #7A54A2;
    color: #fff;
}

.et-view-toggle__btn + .et-view-toggle__btn {
    border-left: 1px solid #e5e7eb;
}

/* ── Template Preview Dialog ── */
.tp-dialog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    min-height: 400px;
}

@media (max-width: 900px) {
    .tp-dialog-layout {
        grid-template-columns: 1fr;
    }
}

.tp-dialog-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tp-dialog-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tp-meta-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: #fafbfc;
}

.tp-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.15rem 0;
}

.tp-meta-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tp-meta-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
}

.tp-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 0.62rem;
    font-weight: 600;
    color: #64748b;
}

.tp-stat-chip--accent {
    background: #fef3c7;
    color: #854d0e;
}

.tp-sheet-block {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tp-sheet-block:hover {
    border-color: #c4b5fd;
    background: #faf8ff;
}

.tp-sheet-block--active {
    border-color: #7A54A2;
    background: #faf8ff;
}

.tp-sheet-block__header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tp-section-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed #e5e7eb;
}

.tp-section-entry {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
}

.tp-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.tp-preview-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tp-chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f5f0ff 0%, #eff6ff 100%);
    border: 1px dashed #c4b5fd;
    border-radius: 8px;
    min-height: 120px;
}

.tp-chart-placeholder__type {
    font-size: 0.72rem;
    font-weight: 700;
    color: #7A54A2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tp-chart-placeholder__title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
}

.tp-chart-placeholder__dims {
    font-size: 0.65rem;
    color: #94a3b8;
}

.tp-table-mockup {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.tp-table-mockup__header {
    display: flex;
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.tp-table-mockup__row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #f1f5f9;
}

.tp-table-mockup__row:last-child {
    border-bottom: none;
}

.tp-table-mockup__cell {
    flex: 1;
    padding: 0.3rem 0.4rem;
    min-width: 0;
    overflow: hidden;
}

.tp-table-mockup__cell--header {
    font-size: 0.58rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-table-mockup__bar {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e0e7ff, #c4b5fd);
    opacity: 0.6;
}

.tp-sheet-chips {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════
   CDR / Detail Reports
   ═══════════════════════════════════════════ */

/* ── DataSource quick-switch bar ── */
.cdr-datasource-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1.25rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(122,84,162,0.04) 0%, rgba(38,55,121,0.04) 100%);
    border: 1px solid #e8e0f0;
    border-radius: 12px;
}

.cdr-datasource-bar__label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    padding-right: 0.75rem;
    border-right: 1px solid #e2e8f0;
}

.cdr-datasource-bar__chips {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.cdr-datasource-bar__chips .mud-button-root {
    transition: all 0.15s ease;
}

.cdr-datasource-bar__chips .mud-button-root:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(122,84,162,0.15);
}

@media (max-width: 768px) {
    .cdr-datasource-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .cdr-datasource-bar__label {
        border-right: none;
        padding-right: 0;
        padding-bottom: 0.35rem;
        border-bottom: 1px solid #e2e8f0;
        width: 100%;
    }
    .cdr-datasource-bar__chips {
        width: 100%;
    }
}

/* ── Filter bar ── */
.cdr-date-presets {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #f1f5f9;
}

.cdr-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.cdr-quick-search {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid #f1f5f9;
}

.cdr-quick-search .mud-input-root {
    font-size: 0.8rem !important;
}

/* ── Filter customizer panel ── */
.cdr-filter-customizer {
    margin-top: 0.6rem;
    padding: 0.75rem;
    border-top: 1px solid #f1f5f9;
    background: linear-gradient(135deg, rgba(122,84,162,0.03) 0%, rgba(38,55,121,0.02) 100%);
    border-radius: 8px;
    animation: cdr-customizer-in 0.2s ease;
}

@keyframes cdr-customizer-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.cdr-filter-customizer__header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.cdr-filter-customizer__items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cdr-filter-customizer__item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #f1f5f9;
    transition: all 0.15s ease;
}

.cdr-filter-customizer__item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.cdr-filter-customizer__item--hidden {
    opacity: 0.5;
    background: #f8fafc;
}

.cdr-filter-customizer__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    min-width: 80px;
}

/* ── Active filter chips ── */
.cdr-chips {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid #f1f5f9;
    align-items: center;
}

.cdr-chips__count {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* ── Status pills (inside Tabulator cells) ── */
.cdr-status-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
}
.cdr-status--delivered {
    background: #f0fdf4;
    color: #059669;
}
.cdr-status--failed {
    background: #fef2f2;
    color: #dc2626;
}
.cdr-status--pending {
    background: #fffbeb;
    color: #d97706;
}

/* ── Channel pills ── */
.cdr-channel-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-radius: 5px;
    letter-spacing: 0.04em;
    line-height: 1.4;
}
.cdr-channel--sms {
    background: #eff6ff;
    color: #2563eb;
}
.cdr-channel--wa {
    background: #f0fdf4;
    color: #059669;
}
.cdr-channel--rcs {
    background: #f5f3ff;
    color: #7c3aed;
}

/* ── Error code badge ── */
.cdr-error-code {
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

/* ── Mono columns ── */
.cdr-col-mono {
    font-family: 'SF Mono', 'Cascadia Code', monospace !important;
    font-size: 0.72rem !important;
    letter-spacing: -0.02em;
}
.cdr-col-date {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* ── Footer info bar ── */
.cdr-footer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 600;
}
.cdr-footer__count,
.cdr-footer__time,
.cdr-footer__page {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.cdr-footer__count {
    color: #0f172a;
    font-weight: 700;
}

/* ── CDR table pagination overrides ── */
#cdr-table .tabulator-footer {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    padding: 0.4rem 0.6rem;
}
#cdr-table .tabulator-footer .tabulator-page {
    font-family: 'Poppins', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 5px;
    padding: 0.2rem 0.5rem;
    color: #475569;
    border: 1px solid #e2e8f0;
    margin: 0 2px;
    transition: all 0.15s ease;
}
#cdr-table .tabulator-footer .tabulator-page:hover {
    background: var(--hubia-primary-a10, rgba(122,84,162,0.10));
    border-color: var(--hubia-chart-1, #7A54A2);
    color: var(--hubia-chart-1, #7A54A2);
}
#cdr-table .tabulator-footer .tabulator-page.active {
    background: var(--hubia-chart-1, #7A54A2);
    color: #fff;
    border-color: var(--hubia-chart-1, #7A54A2);
}
#cdr-table .tabulator-footer .tabulator-page-size {
    font-family: 'Poppins', sans-serif;
    font-size: 0.72rem;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    padding: 0.2rem 0.4rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .cdr-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .cdr-filter-bar > * {
        max-width: 100% !important;
        min-width: 0 !important;
    }
}
