:root {
    --vivo-purple-1: #660099;
    --vivo-purple-2: #8220c7;
    --vivo-night: #2a0d45;
    --vivo-black: #111111;
    --vivo-gray-1: #2f2f35;
    --vivo-gray-2: #e8e8ee;
    --vivo-ink: #26233a;
    --vivo-soft: #f6f7fb;
    --vivo-card: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
    background: radial-gradient(circle at 10% 10%, #efe4ff 0, #f7f7fa 38%, #ececf2 100%);
    color: var(--vivo-ink);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-shape {
    position: fixed;
    border-radius: 999px;
    filter: blur(20px);
    opacity: 0.2;
    z-index: -1;
}

.shape-left {
    width: 360px;
    height: 360px;
    background: linear-gradient(120deg, var(--vivo-purple-2), var(--vivo-gray-1));
    left: -120px;
    top: 80px;
}

.shape-right {
    width: 420px;
    height: 420px;
    background: linear-gradient(160deg, var(--vivo-gray-1), var(--vivo-purple-1));
    right: -150px;
    bottom: -120px;
}

.app-navbar {
    background: linear-gradient(120deg, var(--vivo-night), var(--vivo-purple-1));
    box-shadow: 0 10px 30px rgba(20, 16, 45, 0.28);
}

.navbar .nav-link,
.navbar .navbar-brand {
    color: #fff;
}

.navbar .dropdown-menu {
    border: 0;
    box-shadow: 0 12px 24px rgba(44, 37, 85, 0.18);
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-placeholder {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    padding: 6px;
    background: linear-gradient(130deg, #ffffff 0%, #f1f1f6 100%);
    box-shadow: inset 0 0 0 1px rgba(102, 0, 153, 0.16);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 9px;
}

.admin-access-btn {
    background: linear-gradient(135deg, var(--vivo-purple-2), var(--vivo-purple-1));
    color: #ffffff;
    font-weight: 700;
    border: 0;
}

.admin-access-btn:hover,
.admin-access-btn:focus {
    color: #ffffff;
    filter: brightness(1.04);
}

.admin-logout-btn {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.admin-logout-btn:hover,
.admin-logout-btn:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.24);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.72rem;
    opacity: 0.8;
}

.hero-card {
    background: linear-gradient(120deg, rgba(102, 0, 153, 0.96), rgba(42, 13, 69, 0.92));
    border-radius: 20px;
    color: #fff;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(68, 35, 133, 0.26);
    animation: rise-in 400ms ease both;
}

.panel-card {
    background: var(--vivo-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(26, 16, 55, 0.1);
    border: 1px solid rgba(103, 61, 172, 0.08);
    animation: rise-in 450ms ease both;
}

.table-card {
    border: 1px solid rgba(90, 15, 191, 0.15);
    border-radius: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #fff 0%, #fcfaff 100%);
}

.btn-vivo {
    border: 0;
    color: #fff;
    background: linear-gradient(120deg, var(--vivo-purple-1), var(--vivo-purple-2));
}

.btn-vivo:hover {
    color: #fff;
    filter: brightness(1.05);
}

.app-tabs .nav-link {
    color: var(--vivo-purple-1);
    font-weight: 600;
}

.app-tabs .nav-link.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(120deg, var(--vivo-purple-1), var(--vivo-purple-2));
}

.app-table thead th {
    color: #4a2e75;
    background: #f4ecff;
    border-bottom: 0;
    font-weight: 700;
}

.meta-title-bar {
    border-left: 4px solid var(--vivo-black);
    border-bottom: 2px solid var(--vivo-purple-2);
    background: linear-gradient(120deg, #efeff4, #e3e3eb);
    color: #1e1e22;
    font-weight: 800;
    text-align: center;
    padding: 8px 14px;
    letter-spacing: 0.8px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    margin-bottom: 8px;
}

.meta-mensal-table {
    border: 1px solid #d7d7e0;
    border-radius: 10px;
    overflow: hidden;
}

.meta-mensal-table thead th {
    background: #111111;
    color: #ffffff;
    font-size: 0.78rem;
    letter-spacing: 0.4px;
}

.meta-mensal-table tbody tr:nth-child(odd) {
    background: #f2f2f5;
}

.meta-mensal-table tbody tr:nth-child(even) {
    background: #e9e9ee;
}

.bl-table {
    border: 1px solid #d7d7e0;
    border-radius: 10px;
    overflow: hidden;
}

.bl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.bl-panel {
    border: 1px solid rgba(91, 50, 155, 0.14);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #faf7ff);
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-height: 560px;
}

.bl-panel .meta-title-bar {
    margin-bottom: 10px;
}

.bl-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bl-panel-body .table-responsive {
    flex: 1;
    overflow: auto;
}

.bl-empty-fit {
    flex: 1;
    display: grid;
    place-items: center;
}

.bl-table thead th {
    background: linear-gradient(120deg, #1e1e22, #303038);
    color: #ffffff;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.bl-table tbody td {
    font-size: 0.78rem;
}

.bl-table tbody tr:nth-child(odd) {
    background: #f6f4fb;
}

.bl-table tbody tr:nth-child(even) {
    background: #efeaf8;
}

.bl-row-area td {
    background: #e4dbf4 !important;
    font-weight: 700;
}

.bl-row-rede td {
    background: linear-gradient(120deg, #2a0d45, #4b1f7a) !important;
    color: #ffffff;
    font-weight: 800;
}

.bl-row-pdvs-zero td {
    color: #b42318 !important;
    font-weight: 700;
}

.bl-row-zero-bg td {
    background: #ffcccb !important;
    color: #8b0000 !important;
    font-weight: 700;
}

.bl-compare-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.bl-compare-cell i {
    font-size: 0.95rem;
    line-height: 1;
}

.bl-trend-positive {
    color: #067647;
}

.bl-trend-negative {
    color: #b42318;
}

.bl-trend-neutral {
    color: #d6a100;
}

.bl-tooltip .tooltip-inner {
    text-align: left;
    white-space: normal;
}

.bl-speed-table tbody td:nth-child(3) {
    font-weight: 700;
    color: #4a2e75;
}

.bl-text-danger {
    color: #b42318 !important;
}

.bl-text-neutral {
    color: #111111 !important;
}

.bl-text-success {
    color: #067647 !important;
}

.empty-state {
    border: 1px dashed rgba(90, 15, 191, 0.35);
    border-radius: 14px;
    padding: 28px;
    text-align: center;
    color: #5b4d7c;
}

.empty-state i {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

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

@media (max-width: 991px) {
    .brand-subtitle {
        display: none;
    }

    .navbar .btn {
        margin-top: 8px;
    }

    .bl-grid {
        grid-template-columns: 1fr;
    }

    .bl-panel {
        min-height: auto;
    }
}

/* === Pilar cards (Resultados / Microindicadores / BSC) === */
.pilar-card {
    border: 1px solid rgba(91, 50, 155, 0.14);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #faf7ff);
    padding: 8px;
}
.pilar-card .meta-title-bar { margin-bottom: 10px; }
.resultados-table th, .resultados-table td { white-space: nowrap; }
.resultados-table .bl-row-area td { background: #f3edff; font-weight: 600; }
.resultados-table .bl-row-rede td { background: #5b329b; color: #fff; font-weight: 700; }

/* === Resultados: células legíveis, ainda cabendo na tela (rola vertical) === */
.pilar-card { padding: 10px; margin-bottom: 16px !important; }
.pilar-card .meta-title-bar { margin-bottom: 8px; padding: 7px 14px; font-size: 0.92rem; }
.resultados-table { margin-bottom: 0; }
.resultados-table thead th {
    font-size: 0.74rem;
    padding: 8px 10px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.resultados-table tbody td {
    font-size: 0.86rem;
    padding: 7px 10px;
    line-height: 1.3;
}
.resultados-table .bl-compare-cell i { font-size: 0.95rem; }

/* === Badge "Atualizando em tempo real" === */
.live-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}
.live-status .live-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #d6a100;
    box-shadow: 0 0 0 0 rgba(214, 161, 0, 0.6);
}
.live-status.is-updating .live-dot {
    background: #ffd23f;
    animation: live-pulse 1.1s ease-out infinite;
}
.live-status.is-idle .live-dot {
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.0);
}
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.55); }
    100% { box-shadow: 0 0 0 8px rgba(255, 210, 63, 0); }
}

/* === Microindicadores: dica + modal === */
.micro-hint {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.66rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #571381;
    opacity: 0.75;
}
.micro-modal-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(26, 16, 55, 0.35);
}
.micro-modal-header {
    background: linear-gradient(120deg, var(--vivo-night), var(--vivo-purple-1));
    color: #fff;
    border-bottom: 0;
    padding: 16px 20px;
    align-items: center;
}
.micro-modal-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}
.micro-modal-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 1.35rem;
    color: #fff;
}
.micro-modal-titles { display: flex; flex-direction: column; line-height: 1.15; }
.micro-modal-sub {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    opacity: 0.78;
}
.micro-modal-header .modal-title {
    font-weight: 800;
    letter-spacing: 0.3px;
    font-size: 1.15rem;
}
.micro-modal-header .btn-close { opacity: 0.9; }

/* === Lista de lojas (/gerentes) — grid de cards visuais === */
.gerentes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.gerente-loja-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--vivo-ink);
    background: linear-gradient(180deg, #ffffff 0%, #f7f2fd 100%);
    border: 1px solid rgba(91, 50, 155, 0.16);
    box-shadow: 0 6px 16px rgba(26, 16, 55, 0.07);
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.gerente-loja-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--vivo-purple-1), var(--vivo-purple-2));
}
.gerente-loja-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(68, 35, 133, 0.22);
    border-color: rgba(91, 50, 155, 0.4);
    color: var(--vivo-ink);
}
.gerente-loja-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, var(--vivo-purple-1), var(--vivo-purple-2));
    box-shadow: 0 4px 10px rgba(102, 0, 153, 0.28);
}
.gerente-loja-nome {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.15;
    letter-spacing: 0.2px;
}
.gerente-loja-card::after {
    content: "\F138"; /* bi-chevron-right */
    font-family: "bootstrap-icons";
    position: absolute;
    right: 12px;
    color: var(--vivo-purple-1);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.gerente-loja-card:hover::after { opacity: 0.85; transform: translateX(0); }
