/* Portal B2B — painel gestor TRAIL (layout boxed + dark SaaS) */

.b2b-app {
    --b2b-sidebar-w: 260px;
    --b2b-content-max: 1120px;
    --b2b-radius: 14px;
    --b2b-radius-sm: 10px;
    --b2b-bg: #0b0d11;
    --b2b-surface: #13161c;
    --b2b-surface-2: #1a1e27;
    --b2b-border: rgba(255, 255, 255, 0.07);
    --b2b-border-strong: rgba(255, 255, 255, 0.11);
    --b2b-text: #f1f5f9;
    --b2b-text-muted: #94a3b8;
    --b2b-text-dim: #64748b;
    --b2b-accent: #8b5cf6;
    --b2b-accent-soft: rgba(139, 92, 246, 0.14);
    --b2b-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.35);

    min-height: 100vh;
    min-height: 100dvh;
    background: var(--b2b-bg);
    color: var(--b2b-text);
    display: flex;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

/* ── Sidebar ── */
.b2b-sidebar {
    width: var(--b2b-sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, #12151b 0%, #0f1218 100%);
    border-right: 1px solid var(--b2b-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: transform 0.25s ease;
}

.b2b-sidebar-header {
    padding: 1.25rem 1.15rem 1rem;
    border-bottom: 1px solid var(--b2b-border);
}

.b2b-sidebar-header a {
    display: block;
    line-height: 0;
}

.b2b-sidebar-header img {
    height: 28px;
    width: auto;
}

.b2b-nav {
    flex: 1;
    padding: 0.75rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
}

.b2b-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--b2b-text-dim);
    padding: 0.55rem 0.7rem 0.3rem;
    user-select: none;
}

.b2b-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.62rem 0.8rem;
    border-radius: var(--b2b-radius-sm);
    color: var(--b2b-text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    border: 1px solid transparent;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.b2b-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.b2b-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--b2b-text);
}

.b2b-nav-item.active {
    background: var(--b2b-accent-soft);
    color: #ddd6fe;
    border-color: rgba(139, 92, 246, 0.22);
    box-shadow: inset 3px 0 0 var(--b2b-accent);
}

.b2b-nav-item.active svg {
    opacity: 1;
    color: #c4b5fd;
}

.b2b-sidebar-footer {
    padding: 0.9rem;
    border-top: 1px solid var(--b2b-border);
}

.b2b-user-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0.5rem 0.45rem;
    margin-bottom: 0.55rem;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.b2b-user-card--link {
    border: 1px solid transparent;
    border-radius: var(--b2b-radius-sm);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.b2b-user-card--link:hover,
.b2b-user-card--link.is-active {
    background: var(--b2b-accent-soft);
    border-color: rgba(139, 92, 246, 0.22);
}

.b2b-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--b2b-radius-sm);
    background: var(--b2b-accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.b2b-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    border-radius: var(--b2b-radius-sm);
}

.b2b-user-avatar svg {
    width: 16px;
    height: 16px;
    color: #c4b5fd;
}

.b2b-user-meta {
    min-width: 0;
    flex: 1;
}

.b2b-user-empresa {
    font-size: 12px;
    font-weight: 600;
    color: var(--b2b-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.b2b-user-login {
    font-size: 11px;
    color: var(--b2b-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.b2b-role-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 2px 7px;
    border-radius: 5px;
}

.b2b-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--b2b-text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.b2b-logout-btn:hover {
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.06);
}

.b2b-logout-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Main shell (centered boxed layout) ── */
.b2b-main {
    flex: 1;
    margin-left: var(--b2b-sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse 90% 55% at 50% -15%, rgba(99, 102, 241, 0.11), transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 0%, rgba(139, 92, 246, 0.07), transparent 50%),
        var(--b2b-bg);
}

.b2b-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--b2b-border);
    background: rgba(11, 13, 17, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.b2b-topbar-inner {
    width: 100%;
    max-width: var(--b2b-content-max);
    margin: 0 auto;
    padding: 0.9rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.b2b-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: var(--b2b-surface);
    color: var(--b2b-text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.b2b-menu-toggle svg {
    width: 20px;
    height: 20px;
}

.b2b-page-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--b2b-text);
}

.b2b-content {
    flex: 1;
    width: 100%;
    max-width: var(--b2b-content-max);
    margin: 0 auto;
    padding: 1.75rem 1.75rem 2.75rem;
    box-sizing: border-box;
}

/* ── Page structure ── */
.b2b-page {
    width: 100%;
    margin: 0 auto;
    animation: b2b-fade-in 0.28s ease;
}

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

.b2b-page-intro {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--b2b-border);
}

.b2b-page-intro h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
    line-height: 1.25;
}

.b2b-page-desc {
    font-size: 14px;
    color: var(--b2b-text-muted);
    margin: 0;
    line-height: 1.55;
    max-width: 52ch;
}

/* ── Panels & cards ── */
.b2b-panel {
    background: var(--b2b-surface-2);
    border: 1px solid var(--b2b-border);
    border-radius: var(--b2b-radius);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--b2b-shadow);
}

.b2b-panel + .b2b-panel,
.b2b-panel + .b2b-metrics,
.b2b-metrics + .b2b-panel {
    margin-top: 1.25rem;
}

#b2bDashboardRoot {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

#b2bDashboardRoot > .b2b-dash-grid,
#b2bDashboardRoot > .b2b-panel,
#b2bDashboardRoot > .b2b-analytics-hub,
#b2bDashboardRoot > .b2b-charts-acc {
    margin-top: 0;
    margin-bottom: 0;
}

.b2b-section {
    margin-top: 0;
}

.b2b-section h2,
.b2b-panel-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
    color: var(--b2b-text);
}

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

.b2b-section-head h2 {
    margin: 0;
}

.b2b-link {
    font-size: 13px;
    font-weight: 500;
    color: #c4b5fd;
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.b2b-link:hover {
    background: var(--b2b-accent-soft);
    text-decoration: none;
}

/* ── Metrics ── */
.b2b-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 0;
}

.b2b-metrics--sm {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.b2b-metric-card {
    position: relative;
    padding: 1.15rem 1.2rem;
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    overflow: hidden;
}

.b2b-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, var(--b2b-accent));
    opacity: 0.85;
}

.b2b-metric-val {
    display: block;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--b2b-text);
    margin-top: 0.15rem;
}

.b2b-metric-lbl {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--b2b-text-dim);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Trilhas grid ── */
.b2b-trilhas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.b2b-trilhas-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.b2b-trilha-card {
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border);
    background: var(--b2b-surface);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.b2b-trilha-card--link:hover {
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.b2b-trilha-thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1d26, #0f1118);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--b2b-radius) var(--b2b-radius) 0 0;
}

.b2b-trilha-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--b2b-radius) var(--b2b-radius) 0 0;
}

.b2b-trilha-thumb-ph {
    color: var(--b2b-text-dim);
}

.b2b-trilha-thumb-ph svg {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

.b2b-trilha-body {
    padding: 1rem 1.15rem 1.2rem;
}

.b2b-trilha-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #c4b5fd;
    background: var(--b2b-accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.22);
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.b2b-trilha-body h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 0.45rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.b2b-trilha-meta {
    font-size: 12px;
    color: var(--b2b-text-dim);
    margin: 0;
    line-height: 1.45;
}

.b2b-trilha-card--link {
    cursor: pointer;
}

/* ── Detail page ── */
.b2b-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--b2b-text-muted);
    text-decoration: none;
    margin-bottom: 1.25rem;
    padding: 0.35rem 0.5rem 0.35rem 0;
    border-radius: 6px;
    transition: color 0.15s;
}

.b2b-back-link svg {
    width: 16px;
    height: 16px;
}

.b2b-back-link:hover {
    color: var(--b2b-text);
}

.b2b-detail-hero {
    display: grid;
    grid-template-columns: minmax(200px, 280px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.b2b-detail-thumb-wrap {
    border-radius: var(--b2b-radius-sm);
    overflow: hidden;
    border: 1px solid var(--b2b-border-strong);
    background: #0f1118;
    aspect-ratio: 16 / 10;
}

.b2b-detail-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.b2b-detail-hero-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0.4rem 0 0.5rem;
    line-height: 1.25;
}

.b2b-detail-desc {
    font-size: 14px;
    color: var(--b2b-text-muted);
    margin: 0 0 0.65rem;
    line-height: 1.55;
    max-width: 60ch;
}

/* ── Table ── */
.b2b-table-wrap {
    overflow-x: auto;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    margin-top: 0.5rem;
}

.b2b-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.b2b-table th,
.b2b-table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--b2b-border);
}

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

.b2b-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.b2b-table th {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--b2b-text-dim);
    background: rgba(0, 0, 0, 0.2);
}

.b2b-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

.b2b-pill--concluido { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.b2b-pill--em_progresso { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.b2b-pill--cadastrado { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }
.b2b-pill--sem_conta { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.b2b-pill--atrasado { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.b2b-pill--alerta { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.b2b-pill--suspenso { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.b2b-pill--aprovado { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.b2b-pill--em_analise { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.b2b-pill--reprovado { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.b2b-pill--inscrito { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

.b2b-metric-card--ok::before { background: linear-gradient(90deg, #10b981, #34d399); }

.b2b-score { color: #c4b5fd; font-size: 15px; }

.b2b-row-link:hover td { background: rgba(139, 92, 246, 0.06); }

/* ── Analytics dashboard ── */
.b2b-metrics--lg {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.b2b-metric-card--warn::before {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.b2b-dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0;
}

.b2b-dash-grid > * {
    min-width: 0;
}

.b2b-dist { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.75rem; }
.b2b-dist-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 0.65rem; align-items: center; }
.b2b-dist-label { font-size: 11px; color: var(--b2b-text-dim); }
.b2b-dist-track { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.b2b-dist-fill { height: 100%; border-radius: 4px; min-width: 2px; transition: width 0.4s ease; }
.b2b-dist-count { font-size: 12px; color: var(--b2b-text-muted); white-space: nowrap; }
.b2b-dist-count small { color: var(--b2b-text-dim); }

.b2b-kpi-list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.b2b-kpi-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.55rem 0; border-bottom: 1px solid var(--b2b-border); font-size: 13px;
}
.b2b-kpi-list li:last-child { border-bottom: none; }
.b2b-kpi-list span { color: var(--b2b-text-muted); }
.b2b-kpi-list strong { color: var(--b2b-text); font-weight: 600; }
.b2b-text-warn { color: #f87171 !important; }

.b2b-badge-warn {
    font-size: 11px; font-weight: 600; padding: 0.2rem 0.55rem;
    border-radius: 999px; background: rgba(239,68,68,0.15); color: #fca5a5;
}

.b2b-section--alert { border-color: rgba(245,158,11,0.25); }
.b2b-alert-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.b2b-alert-item {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.75rem 1rem; border-radius: var(--b2b-radius-sm);
    background: rgba(0,0,0,0.2); border: 1px solid var(--b2b-border);
    text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s;
}
.b2b-alert-item:hover { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.06); }
.b2b-alert-item--static { cursor: default; }
.b2b-alert-item--static:hover { border-color: var(--b2b-border); background: rgba(0,0,0,0.2); }
.b2b-alert-item strong { display: block; font-size: 13px; }
.b2b-alert-item .b2b-muted { font-size: 12px; }

.b2b-rank-list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.75rem; }
.b2b-rank-list--sm { margin-top: 0.5rem; }
.b2b-rank-item {
    display: grid; grid-template-columns: 28px 1fr 120px; gap: 0.65rem; align-items: center;
    padding: 0.45rem 0;
}
.b2b-rank-pos {
    width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; background: var(--b2b-accent-soft); color: #c4b5fd;
}
.b2b-rank-info strong { display: block; font-size: 13px; }
.b2b-rank-info .b2b-muted { font-size: 11px; }

.b2b-prog-wrap { display: flex; align-items: center; gap: 0.5rem; min-width: 100px; }
.b2b-prog-track { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.b2b-prog-fill { height: 100%; background: linear-gradient(90deg, #6366f1, var(--b2b-accent)); border-radius: 3px; }
.b2b-prog-fill--done { background: linear-gradient(90deg, #10b981, #34d399); }
.b2b-prog-pct { font-size: 11px; color: var(--b2b-text-dim); min-width: 32px; text-align: right; }

.b2b-subtitle { font-size: 12px; font-weight: 600; color: var(--b2b-text-muted); margin: 1rem 0 0; text-transform: uppercase; letter-spacing: 0.05em; }

.b2b-table--clickable tbody tr { cursor: pointer; }
.b2b-table--clickable tbody tr:hover td { background: rgba(139,92,246,0.08); }

/* ── Filtros participantes ── */
.b2b-filters {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0;
    padding: 0.85rem; border-radius: var(--b2b-radius-sm);
    background: rgba(0,0,0,0.2); border: 1px solid var(--b2b-border);
}
.b2b-filters .b2b-input { flex: 1; min-width: 120px; font-size: 13px; padding: 0.45rem 0.65rem; }
.b2b-filters .b2b-input--xs { flex: 0 1 100px; min-width: 90px; }
.b2b-select { appearance: auto; cursor: pointer; }
.b2b-btn--ghost {
    background: transparent; border: 1px solid var(--b2b-border-strong);
    color: var(--b2b-text-muted); box-shadow: none;
}
.b2b-btn--ghost:hover { background: rgba(255,255,255,0.05); color: var(--b2b-text); }

.b2b-table--parts th:last-child,
.b2b-table--parts td:last-child { width: 104px; text-align: center; }
.b2b-cell-email { font-weight: 500; font-size: 13px; word-break: break-all; }
.b2b-cell-sub { font-size: 11px; color: #a78bfa; margin-top: 2px; }
.b2b-cell-num { font-size: 12px; color: var(--b2b-text-muted); white-space: nowrap; }
.b2b-cell-actions { white-space: nowrap; }
.b2b-icon-btn {
    width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--b2b-border);
    background: rgba(255,255,255,0.04); color: var(--b2b-text-muted); cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0; margin: 0 2px;
}
.b2b-icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--b2b-text); }
.b2b-icon-btn--warn:hover { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.35); }
.b2b-icon-btn--danger:hover { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }

.b2b-pager {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    margin-top: 1rem; font-size: 13px; color: var(--b2b-text-muted);
}

.b2b-panel-title { font-size: 15px; font-weight: 600; margin: 0 0 0.35rem; }

/* ── Materiais ── */
.b2b-materiais-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.b2b-material-item {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.b2b-material-item .b2b-material-row {
    flex: 1;
    min-width: 0;
}

.b2b-material-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.b2b-material-row:hover {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.06);
}

.b2b-material-title {
    font-size: 14px;
    font-weight: 600;
}

.b2b-material-meta {
    font-size: 12px;
    color: var(--b2b-text-dim);
}

.b2b-material-del {
    flex-shrink: 0;
    width: 2.5rem;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--b2b-radius-sm);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.b2b-material-del:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.55);
}

.b2b-material-del:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.b2b-add-mat {
    margin-bottom: 1.15rem;
}

.b2b-add-mat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: flex-end;
}

.b2b-add-mat-row .b2b-form-group {
    flex: 1;
    min-width: 160px;
}

.b2b-input-file {
    padding: 0.45rem 0.65rem;
    font-size: 13px;
}

/* ── Add participantes ── */
.b2b-add-part {
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.15rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid rgba(139, 92, 246, 0.28);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
}

.b2b-add-part-desc {
    font-size: 13px;
    color: var(--b2b-text-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.b2b-add-part-desc strong {
    color: #ddd6fe;
    font-weight: 600;
}

.b2b-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--b2b-text-muted);
    margin-bottom: 0.4rem;
}

.b2b-textarea,
.b2b-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border-strong);
    background: rgba(0, 0, 0, 0.28);
    color: var(--b2b-text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.b2b-textarea:focus,
.b2b-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.b2b-textarea {
    resize: vertical;
    min-height: 88px;
    margin-bottom: 0.85rem;
    line-height: 1.45;
}

.b2b-add-part-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.b2b-add-part-row > div {
    flex: 1;
    min-width: 160px;
}

.b2b-btn {
    padding: 0.65rem 1.15rem;
    border-radius: var(--b2b-radius-sm);
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.b2b-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.b2b-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.b2b-btn.b2b-btn--ghost {
    background: transparent;
    border: 1px solid var(--b2b-border-strong);
    color: var(--b2b-text-muted);
    box-shadow: none;
}

.b2b-btn.b2b-btn--ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--b2b-text);
    transform: none;
    box-shadow: none;
}

.b2b-btn.b2b-btn--outline {
    background: transparent;
    border: 1px solid rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
    box-shadow: none;
}

.b2b-btn.b2b-btn--outline:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.65);
    color: #ede9fe;
    transform: none;
    box-shadow: none;
}

/* ── Perfil ── */
.b2b-perfil-card {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 1.35rem 1.5rem;
}

.b2b-perfil-logo {
    width: 72px;
    height: 72px;
    border-radius: var(--b2b-radius-sm);
    object-fit: cover;
    border: 1px solid var(--b2b-border-strong);
}

.b2b-perfil-logo-ph {
    width: 72px;
    height: 72px;
    border-radius: var(--b2b-radius-sm);
    background: var(--b2b-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.22);
}

.b2b-perfil-logo-ph svg {
    width: 28px;
    height: 28px;
}

.b2b-perfil-info h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.b2b-perfil-role {
    font-size: 13px;
    color: #c4b5fd;
    margin: 0;
    font-weight: 500;
}

.b2b-dl {
    margin: 0;
    display: grid;
    gap: 0;
}

.b2b-dl > div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    font-size: 13px;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--b2b-border);
}

.b2b-dl > div:last-child {
    border-bottom: none;
}

.b2b-dl dt {
    color: var(--b2b-text-dim);
    margin: 0;
    font-weight: 500;
}

.b2b-dl dd {
    margin: 0;
    color: var(--b2b-text);
}

.b2b-dl dd code {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    border: 1px solid var(--b2b-border);
}

.b2b-perfil-note {
    margin-top: 1rem;
    font-size: 12px;
    line-height: 1.5;
}

/* ── Perfil form ── */
.b2b-perfil-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.b2b-form-section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 1.1rem;
    letter-spacing: -0.01em;
    color: var(--b2b-text);
}

.b2b-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.15rem;
}

.b2b-form-group {
    min-width: 0;
}

.b2b-span-2 {
    grid-column: span 2;
}

.b2b-form-check {
    display: flex;
    align-items: center;
}

.b2b-check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 13px;
    color: var(--b2b-text-muted);
    line-height: 1.45;
    cursor: pointer;
}

.b2b-check-label input {
    margin-top: 3px;
    accent-color: var(--b2b-accent);
}

.b2b-input--readonly {
    opacity: 0.75;
    cursor: default;
    background: rgba(0, 0, 0, 0.15);
}

.b2b-field-hint {
    font-size: 11px;
    color: var(--b2b-text-dim);
    margin: 0.35rem 0 0;
    line-height: 1.4;
}

.b2b-field-hint code {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.b2b-usuario-status {
    font-size: 12px;
    margin: 0.4rem 0 0;
    line-height: 1.4;
    font-weight: 500;
}

.b2b-usuario-status--checking {
    color: #a5b4fc;
}

.b2b-usuario-status--ok,
.b2b-usuario-status--same {
    color: #6ee7b7;
}

.b2b-usuario-status--err {
    color: #fca5a5;
}

.b2b-input--ok {
    border-color: rgba(16, 185, 129, 0.45);
}

.b2b-input--err {
    border-color: rgba(239, 68, 68, 0.5);
}

.b2b-input--checking {
    border-color: rgba(99, 102, 241, 0.45);
}

.b2b-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.b2b-logo-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.b2b-logo-drop {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: var(--b2b-radius-sm);
    border: 1px dashed var(--b2b-border-strong);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.b2b-logo-drop .b2b-perfil-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    border-radius: var(--b2b-radius-sm);
}

.b2b-logo-drop .b2b-perfil-logo-ph {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--b2b-radius-sm);
}

.b2b-logo-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.15s;
}

.b2b-logo-drop:hover .b2b-logo-hover {
    opacity: 1;
}

.b2b-logo-fields {
    flex: 1;
    min-width: 200px;
}

.b2b-muted {
    font-size: 13px;
    color: var(--b2b-text-dim);
    margin: 0;
    line-height: 1.5;
}

/* ── Empty & loading ── */
.b2b-empty-state {
    padding: 3rem 2rem;
    text-align: center;
    border-radius: var(--b2b-radius);
    border: 1px dashed var(--b2b-border-strong);
    background: rgba(255, 255, 255, 0.02);
}

.b2b-empty-state--inline {
    padding: 2rem 1.5rem;
}

.b2b-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: var(--b2b-radius-sm);
    background: var(--b2b-accent-soft);
    border: 1px solid rgba(139, 92, 246, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4b5fd;
}

.b2b-empty-icon svg {
    width: 26px;
    height: 26px;
}

.b2b-empty-state h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 0.45rem;
}

.b2b-empty-state p {
    font-size: 13px;
    color: var(--b2b-text-dim);
    margin: 0 auto;
    line-height: 1.55;
    max-width: 380px;
}

.b2b-loading {
    color: var(--b2b-text-dim);
    font-size: 14px;
    text-align: center;
    padding: 2.5rem;
}

/* ── Trilha detail (tabs + hero + curriculum) ── */
.b2b-page--trilha {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.b2b-trilha-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 1.25rem;
    align-items: stretch;
    padding: 1.25rem;
    margin-bottom: 0;
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(19, 22, 28, 0.95) 45%, var(--b2b-surface) 100%);
    overflow: hidden;
}

.b2b-trilha-hero-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: var(--b2b-surface-2);
}

.b2b-trilha-hero-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 0.15rem 0;
}

.b2b-back-link--hero {
    margin-bottom: 0.65rem;
    font-size: 12px;
}

.b2b-trilha-hero .b2b-trilha-status {
    align-self: flex-start;
    margin-bottom: 0.55rem;
}

.b2b-trilha-hero-title {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
    line-height: 1.25;
}

.b2b-trilha-hero-desc {
    font-size: 13px;
    color: var(--b2b-text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.5;
    max-width: 52ch;
}

.b2b-trilha-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.b2b-trilha-hero-chips span {
    font-size: 12px;
    font-weight: 500;
    color: var(--b2b-text-muted);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--b2b-border);
    background: rgba(0, 0, 0, 0.25);
}

.b2b-tabs {
    display: flex;
    gap: 0.25rem;
    margin: 1rem 0 0;
    padding: 0.35rem;
    border-radius: var(--b2b-radius-sm);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--b2b-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.b2b-tabs::-webkit-scrollbar {
    display: none;
}

.b2b-tabs__btn {
    flex: 1 0 auto;
    min-width: max-content;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--b2b-text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.b2b-tabs__btn:hover {
    color: var(--b2b-text);
    background: rgba(255, 255, 255, 0.05);
}

.b2b-tabs__btn.is-active {
    color: #ede9fe;
    background: var(--b2b-accent-soft);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.b2b-tab-panel {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: b2b-tab-in 0.2s ease;
}

.b2b-tab-panel > .b2b-dash-grid,
.b2b-tab-panel > .b2b-panel,
.b2b-tab-panel > .b2b-analytics-hub,
.b2b-tab-panel > .b2b-charts-acc,
.b2b-tab-panel > .b2b-part-filters {
    margin-top: 0;
    margin-bottom: 0;
}

.b2b-tab-panel[hidden] {
    display: none !important;
}

@keyframes b2b-tab-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.b2b-metrics--hero {
    margin-bottom: 0.85rem;
}

.b2b-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--b2b-radius-sm);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--b2b-border);
    font-size: 13px;
    color: var(--b2b-text-muted);
}

.b2b-stats-row strong {
    color: var(--b2b-text);
    font-weight: 600;
}

.b2b-section--flat {
    margin-top: 0;
}

.b2b-section-head--tight {
    margin-top: 1rem;
    margin-bottom: 0.65rem;
}

.b2b-add-collapsible {
    margin-bottom: 1rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px dashed rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.04);
    overflow: hidden;
}

.b2b-add-collapsible-head {
    padding: 0.75rem 1rem;
    font-size: 13px;
    font-weight: 600;
    color: #c4b5fd;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.b2b-add-collapsible-head::-webkit-details-marker {
    display: none;
}

.b2b-add-collapsible[open] .b2b-add-collapsible-head {
    border-bottom: 1px solid var(--b2b-border);
    background: rgba(139, 92, 246, 0.08);
}

.b2b-add-part--compact {
    margin: 0;
    padding: 1rem;
    border: none;
    background: transparent;
}

.b2b-filters--grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: center;
}

.b2b-filters--grid .b2b-input {
    min-width: 0;
    width: 100%;
}

/* ── Filtros participantes (accordion) ── */
.b2b-part-filters {
    margin: 0 0 1.15rem;
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border);
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.b2b-part-filters-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}

.b2b-part-filters-head::-webkit-details-marker {
    display: none;
}

.b2b-part-filters-head:hover {
    background: rgba(255, 255, 255, 0.03);
}

.b2b-part-filters[open] .b2b-part-filters-head {
    border-bottom: 1px solid var(--b2b-border);
    background: rgba(139, 92, 246, 0.06);
}

.b2b-part-filters[open] .b2b-part-filters-chev {
    transform: rotate(90deg);
}

.b2b-part-filters-chev {
    display: inline-flex;
    width: 1.1rem;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--b2b-text-dim);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.b2b-part-filters-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--b2b-text);
    flex: 1;
}

.b2b-part-filters-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--b2b-text-dim);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--b2b-border);
    background: rgba(0, 0, 0, 0.2);
}

.b2b-part-filters-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.b2b-filter-row {
    display: grid;
    gap: 0.75rem;
}

.b2b-filter-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.b2b-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.b2b-filter-field--search .b2b-input {
    font-size: 14px;
    padding: 0.6rem 0.75rem;
}

.b2b-filter-group {
    padding: 0.85rem 0.9rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: rgba(255, 255, 255, 0.02);
}

.b2b-filter-group-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--b2b-text-dim);
    margin-bottom: 0.65rem;
}

.b2b-part-filters .b2b-label {
    margin-bottom: 0;
    font-size: 11px;
    color: var(--b2b-text-muted);
}

.b2b-part-filters .b2b-input {
    font-size: 13px;
    padding: 0.5rem 0.7rem;
    background: rgba(0, 0, 0, 0.25);
    border-color: var(--b2b-border);
}

.b2b-part-filters .b2b-input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.b2b-part-filters-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--b2b-border);
}

.b2b-part-filters-actions .b2b-btn--sm {
    min-width: 7.5rem;
}

.b2b-filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    grid-column: 1 / -1;
}

.b2b-btn--sm {
    padding: 0.45rem 0.85rem;
    font-size: 12px;
}

.b2b-add-mat-row--compact {
    margin: 1rem 0;
    gap: 0.5rem;
}

.b2b-add-mat-row--compact .b2b-input {
    flex: 1;
    min-width: 140px;
}

.b2b-conteudo-head {
    margin-bottom: 1.15rem;
}

.b2b-conteudo-head .b2b-muted {
    margin: 0 0 0.65rem;
    font-size: 13px;
}

.b2b-conteudo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--b2b-text-muted);
}

.b2b-curriculum {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.b2b-mod {
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.b2b-mod-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
}

.b2b-mod-head::-webkit-details-marker {
    display: none;
}

.b2b-mod[open] .b2b-mod-chev {
    transform: rotate(90deg);
}

.b2b-mod-chev {
    display: inline-flex;
    font-size: 1.1rem;
    color: var(--b2b-text-dim);
    transition: transform 0.2s;
    width: 1rem;
    justify-content: center;
}

.b2b-mod-icon {
    color: var(--b2b-text-dim);
    font-size: 13px;
}

.b2b-mod-icon--intro {
    color: #fbbf24;
}

.b2b-mod-title {
    flex: 1;
    min-width: 0;
}

.b2b-mod-meta {
    font-size: 12px;
    font-weight: 500;
    color: var(--b2b-text-dim);
}

.b2b-mod-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.b2b-mod-badge--warn {
    color: #fdba74;
    background: rgba(251, 146, 60, 0.12);
    border: 1px solid rgba(251, 146, 60, 0.25);
}

.b2b-mod-body {
    border-top: 1px solid var(--b2b-border);
    padding: 0.35rem;
}

.b2b-mod-empty {
    padding: 0.75rem 1rem;
    margin: 0;
    font-style: italic;
}

.b2b-lesson {
    display: grid;
    grid-template-columns: 36px 24px 1fr auto;
    gap: 0.65rem;
    align-items: start;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    transition: background 0.15s;
}

.b2b-lesson--clickable {
    cursor: pointer;
}

.b2b-lesson--clickable:hover {
    background: rgba(139, 92, 246, 0.08);
}

.b2b-lesson-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--b2b-text-dim);
    padding-top: 2px;
}

.b2b-lesson-icon {
    color: var(--b2b-text-dim);
    padding-top: 1px;
}

.b2b-lesson-icon svg {
    display: block;
}

.b2b-lesson-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.b2b-lesson-meta {
    display: block;
    font-size: 11px;
    color: var(--b2b-text-dim);
    margin-top: 0.15rem;
}

.b2b-lesson-desc {
    font-size: 12px;
    color: var(--b2b-text-muted);
    margin: 0.35rem 0 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.b2b-lesson-play {
    align-self: center;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--b2b-accent-soft);
    color: #c4b5fd;
    font-size: 10px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.b2b-lesson--video .b2b-lesson-play {
    opacity: 1;
}

.b2b-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.b2b-modal-box {
    width: min(520px, 100%);
    max-height: min(90vh, 720px);
    overflow: auto;
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border-strong);
    background: var(--b2b-surface);
    box-shadow: var(--b2b-shadow);
}

.b2b-modal-box--wide {
    width: min(720px, 100%);
}

.b2b-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--b2b-border);
}

.b2b-modal-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.b2b-modal-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--b2b-text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.b2b-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--b2b-text);
}

.b2b-modal-body {
    padding: 1rem 1.15rem 1.15rem;
}

.b2b-modal-lead {
    margin: 0 0 1rem;
    font-size: 13px;
    line-height: 1.5;
}

.b2b-modal-sub {
    margin: 0 0 0.75rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--b2b-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.b2b-modal-notice {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid rgba(168, 85, 247, 0.25);
    background: rgba(168, 85, 247, 0.08);
    font-size: 13px;
}

.b2b-modal-divider {
    border: none;
    border-top: 1px solid var(--b2b-border);
    margin: 1rem 0;
}

.b2b-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.15rem;
}

.b2b-modal-actions--split {
    justify-content: flex-start;
    margin-top: 0;
}

.b2b-field-hint {
    margin: 0.35rem 0 0;
    font-size: 12px;
    color: var(--b2b-text-dim);
}

.b2b-radio-group {
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.b2b-radio-opt {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-size: 13px;
}

.b2b-radio-opt input {
    margin-top: 0.15rem;
    accent-color: #8b5cf6;
}

.b2b-radio-opt span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.b2b-radio-opt small {
    font-size: 12px;
    color: var(--b2b-text-muted);
    font-weight: 400;
}

.b2b-field--dias {
    margin-top: 0.75rem;
}

.b2b-btn--warn {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fff;
}

.b2b-btn--warn:hover {
    filter: brightness(1.06);
}

.b2b-lesson-video {
    width: 100%;
    max-height: 50vh;
    border-radius: var(--b2b-radius-sm);
    background: #000;
    display: block;
}

.b2b-lesson-text-preview {
    font-size: 14px;
    line-height: 1.6;
    color: var(--b2b-text-muted);
    white-space: pre-wrap;
}

.b2b-lesson--atividade .b2b-lesson-play--quiz {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fbbf24;
    font-weight: 700;
    font-size: 13px;
}

.b2b-lesson--atividade .b2b-lesson-icon {
    color: #fbbf24;
}

.b2b-atividade-preview-note {
    margin: 0 0 0.35rem;
    font-size: 12px;
    color: var(--b2b-text-muted);
}

.b2b-atividade-preview-sub {
    margin: 0 0 1rem;
    font-size: 13px;
    color: var(--b2b-text-muted);
}

.b2b-atividade-preview-progress {
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 0.75rem;
}

.b2b-atividade-preview-question {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    margin: 0 0 1rem;
}

.b2b-atividade-preview-options {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: grid;
    gap: 8px;
}

.b2b-atividade-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--b2b-border);
    background: rgba(255, 255, 255, 0.02);
    font-size: 14px;
    line-height: 1.45;
}

.b2b-atividade-opt--correct {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.08);
}

.b2b-atividade-opt-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4ade80;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.15);
}

.b2b-lesson-modal-desc {
    margin: 0.85rem 0 0;
    font-size: 13px;
    color: var(--b2b-text-muted);
    line-height: 1.5;
}

.b2b-empty-state--inline {
    padding: 1.5rem 1rem;
    text-align: center;
}

/* ── Analytics accordion ── */
.b2b-analytics-acc {
    margin-bottom: 1rem;
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border);
    background: var(--b2b-surface);
    overflow: hidden;
}

.b2b-analytics-acc-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}

.b2b-analytics-acc-head::-webkit-details-marker {
    display: none;
}

.b2b-analytics-acc-head:hover {
    background: rgba(255, 255, 255, 0.03);
}

.b2b-analytics-acc[open] .b2b-analytics-acc-head {
    border-bottom: 1px solid var(--b2b-border);
    background: rgba(139, 92, 246, 0.06);
}

.b2b-analytics-acc[open] .b2b-analytics-acc-chev {
    transform: rotate(90deg);
}

.b2b-analytics-acc-chev {
    display: inline-flex;
    width: 1.25rem;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--b2b-text-dim);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.b2b-analytics-acc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--b2b-text);
    flex: 1;
    min-width: 0;
}

.b2b-analytics-acc-preview {
    font-size: 12px;
    font-weight: 500;
    color: var(--b2b-text-dim);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--b2b-border);
}

.b2b-analytics-acc-body {
    display: flex;
    flex-direction: column;
}

.b2b-analytics-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--b2b-border);
    transition: background 0.12s;
}

.b2b-analytics-row:last-child {
    border-bottom: none;
}

.b2b-analytics-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.b2b-analytics-lbl {
    font-size: 13px;
    font-weight: 500;
    color: var(--b2b-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.b2b-analytics-val {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--b2b-text);
    text-align: right;
    flex-shrink: 0;
}

.b2b-analytics-row--warn .b2b-analytics-val {
    color: #fbbf24;
}

.b2b-analytics-row--ok .b2b-analytics-val {
    color: #34d399;
}

.b2b-analytics-row--warn {
    border-left: 3px solid rgba(251, 191, 36, 0.5);
}

.b2b-analytics-row--ok {
    border-left: 3px solid rgba(52, 211, 153, 0.45);
}

/* ── Analytics hub (indicador + gráfico) ── */
.b2b-analytics-hub {
    margin-bottom: 0;
}

.b2b-analytics-export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid var(--b2b-border);
}

.b2b-analytics-export-bar .b2b-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.b2b-export-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 21, 0.72);
    backdrop-filter: blur(4px);
}

.b2b-export-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: var(--b2b-surface);
    min-width: 220px;
}

.b2b-export-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: b2b-export-spin 0.7s linear infinite;
}

@keyframes b2b-export-spin {
    to { transform: rotate(360deg); }
}

.b2b-export-overlay-text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--b2b-text-muted);
}

/* Pré-visualização HTML / PDF — Analytics (mesmo padrão do portfólio) */
.b2b-pdf-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.b2b-pdf-preview-panel {
    display: flex;
    flex-direction: column;
    width: min(920px, 96vw);
    max-height: 92vh;
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border-strong);
    background: var(--b2b-surface);
    box-shadow: var(--b2b-shadow);
    overflow: hidden;
}

.b2b-pdf-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--b2b-border);
}

.b2b-pdf-preview-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--b2b-text);
}

.b2b-pdf-preview-status {
    margin: 0.25rem 0 0;
    font-size: 12px;
    color: #a78bfa;
}

.b2b-pdf-preview-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--b2b-text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.b2b-pdf-preview-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--b2b-text);
}

.b2b-pdf-preview-body {
    flex: 1;
    min-height: 0;
    background: #1f2937;
}

.b2b-pdf-preview-frame {
    width: 100%;
    height: min(68vh, 720px);
    border: 0;
    display: block;
    background: #fff;
}

.b2b-pdf-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--b2b-border);
}

.b2b-analytics-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.b2b-analytic-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.05rem 1.25rem;
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.22) 100%);
    min-height: 260px;
    align-items: stretch;
}

.b2b-analytic-card--wide {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    min-height: 0;
    gap: 1rem;
}

.b2b-analytic-card--warn {
    border-color: rgba(251, 191, 36, 0.28);
    background: linear-gradient(160deg, rgba(251, 191, 36, 0.06) 0%, rgba(0, 0, 0, 0.22) 100%);
}

.b2b-analytic-card--ok {
    border-color: rgba(52, 211, 153, 0.28);
}

.b2b-analytic-card-text {
    flex: 1 1 auto;
    min-width: 0;
}

.b2b-analytic-card--wide .b2b-analytic-card-text {
    flex: 0 1 280px;
    max-width: 320px;
}

.b2b-analytic-title {
    margin: 0 0 0.35rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--b2b-text);
    letter-spacing: -0.01em;
}

.b2b-analytic-desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--b2b-text-muted);
}

.b2b-analytic-value {
    margin-top: 0.65rem;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--b2b-text);
}

.b2b-analytic-value--warn {
    color: #fbbf24;
}

.b2b-analytic-value--ok {
    color: #34d399;
}

.b2b-analytic-chart-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 148px;
    height: 148px;
    min-height: 0;
    margin: auto auto 0;
    align-self: center;
}

.b2b-analytic-chart-wrap--wide {
    width: auto;
    height: auto;
    min-height: 200px;
    flex: 1 1 300px;
    min-width: min(100%, 360px);
    margin: 0;
    align-self: stretch;
}

.b2b-analytic-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.b2b-analytic-chart-wrap .b2b-chart-empty {
    min-height: 120px;
    padding: 1rem;
    font-size: 12px;
}

/* ── Charts grid ── */
.b2b-charts-acc {
    margin-bottom: 1.25rem;
}

.b2b-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.b2b-chart-card {
    border-radius: var(--b2b-radius-sm);
    border: 1px solid var(--b2b-border);
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.b2b-chart-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--b2b-text);
}

.b2b-chart-type {
    margin: 0.2rem 0 0.65rem;
    font-size: 11px;
    color: var(--b2b-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.b2b-chart-wrap {
    position: relative;
    flex: 1;
    min-height: 200px;
}

.b2b-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.b2b-chart-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--b2b-text-dim);
    text-align: center;
    padding: 1.5rem;
    border: 1px dashed var(--b2b-border);
    border-radius: 8px;
}

/* ── Toast ── */
.b2b-toast {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 0.75rem 1.15rem;
    border-radius: var(--b2b-radius-sm);
    font-size: 13px;
    font-weight: 500;
    max-width: min(360px, calc(100vw - 2rem));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.b2b-toast--ok {
    background: #064e3b;
    color: #d1fae5;
    border: 1px solid #10b981;
}

.b2b-toast--error {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #ef4444;
}

.b2b-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 150;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .b2b-metrics,
    .b2b-metrics--sm,
    .b2b-metrics--lg {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .b2b-dash-grid {
        grid-template-columns: 1fr;
    }

    .b2b-detail-hero {
        grid-template-columns: 1fr;
    }

    .b2b-detail-thumb-wrap {
        max-width: 320px;
    }

    .b2b-trilha-hero {
        grid-template-columns: 1fr;
    }

    .b2b-trilha-hero-img {
        max-height: 180px;
        aspect-ratio: 16 / 9;
    }

    .b2b-filters--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .b2b-analytics-hub-grid {
        grid-template-columns: 1fr;
    }

    .b2b-analytic-card--wide {
        flex-direction: column;
    }

    .b2b-analytic-card--wide .b2b-analytic-card-text {
        max-width: none;
    }

    .b2b-charts-grid {
        grid-template-columns: 1fr;
    }

    .b2b-filter-row--2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .b2b-sidebar {
        transform: translateX(-100%);
    }

    .b2b-sidebar.open {
        transform: translateX(0);
    }

    .b2b-overlay.visible {
        display: block;
    }

    .b2b-main {
        margin-left: 0;
    }

    .b2b-menu-toggle {
        display: flex;
    }

    .b2b-content {
        padding: 1.25rem 1rem 2rem;
    }

    .b2b-topbar-inner {
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 520px) {
    .b2b-metrics,
    .b2b-metrics--sm {
        grid-template-columns: 1fr 1fr;
    }

    .b2b-dl > div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .b2b-add-part-row,
    .b2b-add-mat-row {
        flex-direction: column;
        align-items: stretch;
    }

    .b2b-btn {
        width: 100%;
    }

    .b2b-part-filters-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .b2b-part-filters-actions .b2b-btn--sm {
        width: 100%;
    }

    .b2b-form-grid {
        grid-template-columns: 1fr;
    }

    .b2b-span-2 {
        grid-column: span 1;
    }

    .b2b-tabs__btn {
        flex: 0 0 auto;
        padding: 0.5rem 0.75rem;
        font-size: 12px;
    }

    .b2b-filters--grid {
        grid-template-columns: 1fr;
    }

    .b2b-lesson {
        grid-template-columns: 28px 20px 1fr;
    }

    .b2b-lesson-play {
        display: none;
    }
}

/* Demo embarcada em iframe (/demo.html) — corrige bloco cinza (min-height 100dvh + flex:1) */
html.demo-embed,
html.demo-embed body.b2b-app {
    height: 100%;
    min-height: 0 !important;
    max-height: 100%;
    overflow: hidden;
}

html.demo-embed .b2b-app {
    min-height: 0 !important;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

html.demo-embed .b2b-main {
    min-height: 0 !important;
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Não esticar área de conteúdo — só a altura real do dashboard */
html.demo-embed .b2b-content {
    flex: 0 0 auto !important;
    min-height: 0;
    height: auto;
}

html.demo-embed .b2b-page,
html.demo-embed #b2bDashboardRoot {
    height: auto;
    min-height: 0;
    overflow: visible;
}

html.demo-embed #b2bDashboardRoot {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

html.demo-embed .b2b-analytic-card {
    min-height: 0;
}

html.demo-embed .b2b-analytic-chart-wrap {
    width: 130px;
    height: 130px;
}

html.demo-embed .b2b-analytic-chart-wrap--wide {
    width: auto;
    height: auto;
    min-height: 180px;
}

html.demo-embed .b2b-overlay {
    display: none !important;
}

/* ── Border-radius global: imagens de conteúdo sem classe específica ── */

/* Toda imagem dentro de um painel/seção de conteúdo que não tenha classe própria */
.b2b-panel img,
.b2b-section img,
.b2b-page img {
    border-radius: var(--b2b-radius-sm);
}

/* Imagens dentro de containers com overflow:hidden que já fazem o clip */
.b2b-trilha-thumb img,
.b2b-detail-thumb-wrap img,
.b2b-user-avatar img,
.b2b-logo-drop img {
    border-radius: inherit;
}

/* Logotipo da plataforma na sidebar — sem radius */
.b2b-sidebar-header img {
    border-radius: 0;
}
