/* Elo Forte — tema escuro inspirado no painel do X32 CRM. Troque as cores da marca aqui. */
/* Identidade Elo Forte: preto e aço escovado (logo oficial). */
:root,
[data-bs-theme="dark"] {
    --ef-bg: #0a0a0b;
    --ef-surface: #131416;
    --ef-surface-2: #1a1b1e;
    --ef-border: #26282c;
    --ef-text: #ebedf0;
    --ef-muted: #8d929b;
    --ef-steel: #c9ced6;
    --ef-steel-dark: #8e959f;
    --ef-steel-gradient: linear-gradient(180deg, #f2f4f7 0%, #c4c9d1 45%, #9aa1ab 100%);
    --ef-accent: #c9ced6;
    --ef-accent-soft: rgba(201, 206, 214, .14);
    --ef-good: #22c55e;
    --ef-bad: #ef4444;
    --ef-warn: #f59e0b;
    --ef-radius: 12px;

    --bs-body-bg: var(--ef-bg);
    --bs-body-color: var(--ef-text);
    --bs-border-color: var(--ef-border);
    --bs-secondary-color: var(--ef-muted);
    --bs-primary: var(--ef-steel);
    --bs-primary-rgb: 201, 206, 214;
    --bs-link-color: #d7dbe1;
    --bs-link-color-rgb: 215, 219, 225;
    --bs-link-hover-color: #ffffff;
    --bs-link-hover-color-rgb: 255, 255, 255;
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--ef-bg);
    color: var(--ef-text);
    min-height: 100vh;
}

/* ---------- Estrutura do painel ---------- */
.ef-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 64px;
    background: var(--ef-bg);
    border-bottom: 1px solid var(--ef-border);
}

.ef-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.ef-brand img {
    height: 30px;
    width: auto;
}

.ef-brand-lg img { height: 56px; }

.ef-sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    width: 72px;
    padding: 16px 0;
    background: var(--ef-bg);
    border-right: 1px solid var(--ef-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 1020;
}

.ef-sidebar a {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ef-muted);
    font-size: 1.1rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.ef-sidebar a:hover,
.ef-sidebar a.active {
    background: var(--ef-surface-2);
    color: var(--ef-text);
}

.ef-sidebar a.active { color: #fff; box-shadow: inset 2px 0 0 var(--ef-steel); }

.ef-main {
    margin-left: 72px;
    padding: 28px;
}

@media (max-width: 767.98px) {
    .ef-sidebar {
        top: auto;
        bottom: 0;
        width: 100%;
        height: 64px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0 8px;
        border-right: 0;
        border-top: 1px solid var(--ef-border);
    }

    .ef-main {
        margin-left: 0;
        padding: 20px 16px 88px;
    }
}

/* ---------- Cards ---------- */
.ef-card {
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius);
    padding: 20px;
    height: 100%;
}

.ef-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.ef-kpi-label {
    font-size: .85rem;
    color: var(--ef-muted);
    margin-bottom: .25rem;
}

.ef-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.ef-kpi-note {
    font-size: .8rem;
    color: var(--ef-muted);
}

.ef-up { color: var(--ef-good); }
.ef-down { color: var(--ef-bad); }

.ef-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--ef-surface-2);
    color: var(--ef-muted);
}

.ef-badge-good { background: rgba(34, 197, 94, .14); color: var(--ef-good); }
.ef-badge-warn { background: rgba(245, 158, 11, .14); color: var(--ef-warn); }
.ef-badge-bad { background: rgba(239, 68, 68, .14); color: var(--ef-bad); }

.ef-empty {
    text-align: center;
    color: var(--ef-muted);
    padding: 24px 8px;
}

.ef-empty i { font-size: 2rem; margin-bottom: .5rem; opacity: .6; }

/* ---------- Formulários ---------- */
.form-control,
.form-select {
    background-color: var(--ef-surface-2);
    border-color: var(--ef-border);
    color: var(--ef-text);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--ef-surface-2);
    border-color: var(--ef-accent);
    color: var(--ef-text);
    box-shadow: 0 0 0 .2rem var(--ef-accent-soft);
}

.form-control::placeholder { color: #5d677a; }

.btn-primary {
    --bs-btn-color: #111214;
    --bs-btn-hover-color: #000;
    --bs-btn-active-color: #000;
    --bs-btn-disabled-color: #111214;
    --bs-btn-border-color: #aeb4bd;
    --bs-btn-hover-border-color: #d9dde3;
    --bs-btn-active-border-color: #d9dde3;
    background-image: var(--ef-steel-gradient);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus-visible { filter: brightness(1.08); }

.form-check-input:checked {
    background-color: var(--ef-steel);
    border-color: var(--ef-steel);
}

.ef-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.ef-auth-card {
    width: 100%;
    max-width: 440px;
}

/* ---------- Planos ---------- */
.ef-plan {
    position: relative;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}

.ef-plan:hover { border-color: #33435f; transform: translateY(-2px); }

.ef-plan.ef-plan-featured { border-color: var(--ef-accent); }

.ef-plan-tag {
    position: absolute;
    top: -11px;
    right: 16px;
    background: var(--ef-steel-gradient);
    color: #111214;
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 999px;
}

.ef-plan-price { font-size: 2rem; font-weight: 700; }
.ef-plan-price small { font-size: .9rem; font-weight: 400; color: var(--ef-muted); }

.ef-invite-input {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: .9rem;
}

.table { --bs-table-bg: transparent; --bs-table-color: var(--ef-text); }
.table > :not(caption) > * > * { border-bottom-color: var(--ef-border); }

/* ---------- Onde economizar (carrossel) ---------- */
.ef-carousel {
    --ef-per-view: 4;
    --ef-gap: 16px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--ef-per-view) - 1) * var(--ef-gap)) / var(--ef-per-view));
    gap: var(--ef-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.ef-carousel::-webkit-scrollbar { display: none; }
.ef-carousel:focus-visible { outline: 2px solid var(--ef-steel); outline-offset: 4px; border-radius: var(--ef-radius); }

@media (max-width: 1199.98px) { .ef-carousel { --ef-per-view: 3; } }
@media (max-width: 991.98px) { .ef-carousel { --ef-per-view: 2; } }
@media (max-width: 575.98px) { .ef-carousel { --ef-per-view: 1; } }

.ef-carousel-item { scroll-snap-align: start; min-width: 0; }

.ef-partner { display: flex; flex-direction: column; }

.ef-partner-logo {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--ef-surface-2);
    border: 1px solid var(--ef-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    color: var(--ef-steel);
    letter-spacing: .04em;
}

.ef-partner-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.ef-partner-discount { color: var(--ef-muted); font-size: .9rem; }
.ef-partner-discount span { font-size: 1.35rem; font-weight: 700; color: var(--ef-good); margin-right: .15rem; }
.ef-partner-benefit { font-weight: 600; color: var(--ef-text); }
.ef-partner-benefit i { color: var(--ef-steel); margin-right: .25rem; }

.ef-badge-channel-fisica { background: rgba(201, 206, 214, .12); color: var(--ef-steel); }
.ef-badge-channel-online { background: rgba(56, 189, 248, .14); color: #7dd3fc; }
.ef-badge-channel-fisica_online { background: rgba(34, 197, 94, .14); color: #86efac; }

.ef-carousel-btn:disabled { opacity: .35; }
.min-w-0 { min-width: 0; }

/* ---------- Área administrativa ---------- */
.ef-sidebar-admin { margin-top: auto; }

/* Grupos do menu: no computador ficam em coluna; no celular, um de cada lado do botão do QR. */
.ef-nav-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ef-nav-group-end { flex: 1; }

/* Botão do QR Code: círculo branco em destaque. */
.ef-sidebar a.ef-nav-qr {
    width: 52px;
    height: 52px;
    margin: 4px 0;
    border-radius: 50%;
    background: #fff;
    color: #0a0a0b;
    font-size: 1.6rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .12);
}
.ef-sidebar a.ef-nav-qr:hover,
.ef-sidebar a.ef-nav-qr.active { background: var(--ef-steel-gradient); color: #0a0a0b; box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 0 0 3px rgba(201, 206, 214, .35); }

.ef-topbar-user { color: var(--ef-muted); text-decoration: none; font-size: 1rem; }
.ef-topbar-user:hover, .ef-topbar-user.active { color: var(--ef-text); }
.ef-topbar-user .fa-circle-user { font-size: 1.5rem; vertical-align: middle; }
.ef-badge-admin { background: var(--ef-accent-soft); color: var(--ef-steel); }

.ef-admin-nav { gap: 4px; scrollbar-width: none; }
.ef-admin-nav::-webkit-scrollbar { display: none; }
.ef-admin-nav .nav-link {
    color: var(--ef-muted);
    border-radius: 8px;
    padding: .4rem .8rem;
    white-space: nowrap;
}
.ef-admin-nav .nav-link:hover { color: var(--ef-text); background: var(--ef-surface-2); }
.ef-admin-nav .nav-link.active { color: #0a0a0b; background: var(--ef-steel-gradient); font-weight: 600; }

.ef-partner-logo-sm { width: 40px; height: 40px; font-size: .8rem; flex: 0 0 40px; }
.ef-form-narrow { max-width: 720px; }
.ef-wa-qr { width: 220px; max-width: 100%; background: #fff; padding: 8px; border-radius: 8px; }

.dropdown-menu { --bs-dropdown-bg: var(--ef-surface-2); --bs-dropdown-border-color: var(--ef-border); --bs-dropdown-link-hover-bg: var(--ef-surface); }
.pagination { --bs-pagination-bg: var(--ef-surface); --bs-pagination-border-color: var(--ef-border); --bs-pagination-color: var(--ef-text); --bs-pagination-active-bg: var(--ef-steel); --bs-pagination-active-border-color: var(--ef-steel); --bs-pagination-active-color: #0a0a0b; --bs-pagination-disabled-bg: var(--ef-surface); }

@media (max-width: 767.98px) {
    .ef-sidebar-admin { margin-top: 0; }
    .ef-nav-group { flex: 1; flex-direction: row; justify-content: space-around; gap: 0; }
    .ef-sidebar a.ef-nav-qr {
        flex: 0 0 64px;
        width: 64px;
        height: 64px;
        margin: -28px 6px 0;
        font-size: 2rem;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .55), 0 0 0 4px var(--ef-bg);
    }
}

/* ---------- Carteirinha (QR dinâmico) ---------- */
.ef-card-pass { max-width: 420px; }
.ef-member-code { font-size: 1.6rem; font-weight: 700; letter-spacing: .04em; background: var(--ef-steel-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ef-pass-qr { width: 260px; max-width: 100%; background: #fff; padding: 10px; border-radius: 14px; transition: opacity .2s; }
.ef-pass-qr img { width: 100%; height: auto; display: block; }
.ef-pass-qr.ef-pass-stale { opacity: .35; }
.ef-pass-timer .progress { height: 4px; background: var(--ef-surface-2); }
.ef-pass-timer .progress-bar { background: var(--ef-steel-gradient); transition: width 1s linear; }

/* ---------- Relatórios ---------- */
.ef-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ef-chart-grid { stroke: var(--ef-border); stroke-dasharray: 3 4; }
.ef-chart-base { stroke: var(--ef-border); }
.ef-chart-axis { fill: var(--ef-muted); font-size: 11px; }
.ef-chart-value { fill: var(--ef-text); font-size: 11px; font-weight: 600; }
.ef-chart-bar { fill: var(--ef-steel-dark); transition: fill .12s; }
.ef-chart-hit { fill: transparent; }
.ef-chart-col:hover .ef-chart-bar { fill: var(--ef-steel); }
.ef-chart-col:hover .ef-chart-hit { fill: rgba(255, 255, 255, .03); }
.ef-chart-tip { position: fixed; z-index: 2000; pointer-events: none; background: var(--ef-surface-2); color: var(--ef-text); border: 1px solid var(--ef-border); border-radius: 8px; padding: 4px 8px; font-size: .8rem; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); white-space: nowrap; }
.ef-rank-row + .ef-rank-row { margin-top: 12px; }
.ef-rank-track { height: 8px; background: var(--ef-surface-2); border-radius: 4px; overflow: hidden; }
.ef-rank-bar { height: 100%; background: var(--ef-steel-dark); border-radius: 0 4px 4px 0; }
