/* ============================================================
   INFOWAY — DASHBOARD OPERACIONAL
   ============================================================ */

:root {

    --bg: #05090e;
    --bg-soft: #080d13;
    --card: #090f16;
    --card-hover: #0c131c;

    --border: rgba(255,255,255,.08);
    --border-blue: rgba(0,132,255,.25);

    --text: #f4f7fb;
    --text-soft: #a5b1c2;
    --text-muted: #66758a;

    --blue: #1685f5;
    --blue-light: #38a0ff;

    --orange: #ff8a1f;
    --purple: #9d5cff;
    --red: #ff465c;

    --radius: 22px;
    --radius-small: 14px;

    --shadow:
        0 18px 50px rgba(0,0,0,.28);

}


/* ============================================================
   RESET
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {

    min-height: 100vh;

    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(0,120,255,.07),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 20%,
            rgba(0,120,255,.035),
            transparent 25%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;

    overflow-x: hidden;
}


button,
select,
input {
    font: inherit;
}


/* ============================================================
   APP
   ============================================================ */

.app {
    width: 100%;
    min-height: 100vh;
}


/* ============================================================
   HEADER
   ============================================================ */

.topbar {

    width: min(1440px, calc(100% - 56px));

    margin: 0 auto;

    min-height: 92px;

    padding: 14px 0;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: 12px;
    column-gap: 16px;

    border-bottom: 1px solid rgba(255,255,255,.055);
}


.brand-area {

    display: flex;
    align-items: center;
    gap: 20px;
}


.brand-logo {

    width: 145px;
    height: 58px;

    object-fit: contain;

    /* A logo deve ser PNG transparente */
    background: transparent;
}


.brand-line {

    width: 1px;
    height: 32px;

    background: rgba(255,255,255,.13);
}


.brand-name {

    display: flex;
    align-items: center;
    gap: 5px;

    font-size: 14px;
    letter-spacing: .5px;
}


.brand-name span {
    color: var(--blue-light);
    font-weight: 700;
}


.brand-name strong {
    color: var(--text);
    font-weight: 600;
}


.update-area {

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;

    flex: 1 1 auto;
    min-width: 0;

    color: var(--text-soft);

    text-align: right;
}


.update-area small {

    display: block;

    color: var(--text-muted);

    font-size: 11px;
}


.update-area strong {

    display: block;

    margin-top: 2px;

    color: var(--text);

    font-size: 13px;
}


.update-dot {

    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: var(--blue);

    box-shadow:
        0 0 0 5px rgba(22,133,245,.10),
        0 0 18px rgba(22,133,245,.5);

    animation: pulse 2.2s infinite;
}


@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }

}


/* ============================================================
   CONTENT
   ============================================================ */

.content {

    width: min(1440px, calc(100% - 56px));

    margin: 0 auto;

    padding: 32px 0 60px;
}


/* ============================================================
   HERO
   ============================================================ */

.hero-card {

    position: relative;

    padding: 38px 42px;

    border: 1px solid var(--border);

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            rgba(11,21,32,.95),
            rgba(7,12,18,.94)
        );

    overflow: hidden;

    box-shadow: var(--shadow);
}


.hero-card::before {

    content: "";

    position: absolute;

    width: 300px;
    height: 300px;

    right: -120px;
    top: -160px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(22,133,245,.13),
            transparent 70%
        );

    pointer-events: none;
}


.section-label {

    display: block;

    margin-bottom: 8px;

    color: #6ea4d5;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 2px;

    text-transform: uppercase;
}


.hero-card h1 {

    font-size: clamp(42px, 5vw, 68px);

    line-height: .98;

    letter-spacing: -3px;

    font-weight: 800;

    color: #f7f9fc;
}


.hero-card h2 {

    margin-top: 20px;

    font-size: 20px;

    font-weight: 700;

    letter-spacing: -.4px;
}


.hero-card p {

    margin-top: 8px;

    max-width: 650px;

    color: var(--text-soft);

    font-size: 14px;

    line-height: 1.7;
}


/* ============================================================
   FILTROS
   ============================================================ */

.filters-card {

    margin-top: 18px;

    padding: 20px;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: rgba(8,13,19,.82);

    display: grid;

    grid-template-columns: 120px 1fr;

    gap: 20px;

    align-items: end;
}


.filter-title {

    display: flex;
    flex-direction: column;

    gap: 8px;
}


.filter-title > span {

    color: #6ea4d5;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 2px;
}


.filter-title button {

    width: fit-content;

    border: 0;

    background: transparent;

    color: var(--blue-light);

    font-size: 12px;

    cursor: pointer;

    padding: 0;
}


.filters {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 14px;
}


.filter-group label {

    display: block;

    margin: 0 0 8px 2px;

    color: var(--text-muted);

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 1.5px;
}


.filter-group select {

    width: 100%;

    height: 48px;

    padding: 0 16px;

    border-radius: 13px;

    border: 1px solid var(--border);

    outline: none;

    color: var(--text);

    background:
        #0b1118
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23798ba1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
        no-repeat right 15px center;

    appearance: none;

    cursor: pointer;

    transition: .2s ease;
}


.filter-group select:hover,
.filter-group select:focus {

    border-color: rgba(22,133,245,.45);

    background-color: #0d151e;
}


/* ============================================================
   KPI CARDS
   ============================================================ */

.kpi-grid {

    margin-top: 18px;

    display: grid;

    grid-template-columns:
        1.25fr
        repeat(4, 1fr);

    gap: 14px;
}


.kpi-card {

    position: relative;

    min-height: 154px;

    padding: 22px;

    border: 1px solid var(--border);

    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            #0b1118,
            #080d13
        );

    overflow: hidden;

    transition:
        transform .25s ease,
        border-color .25s ease,
        background .25s ease;
}


.kpi-card:hover {

    transform: translateY(-3px);

    border-color: rgba(255,255,255,.13);

    background: var(--card-hover);
}


.kpi-card.primary {

    border-color:
        rgba(22,133,245,.45);

    background:
        radial-gradient(
            circle at 90% 0%,
            rgba(22,133,245,.13),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            #0b1520,
            #080d13
        );
}


.kpi-header {

    display: flex;
    align-items: center;
    justify-content: space-between;
}


.kpi-header span {

    color: #6f8eaf;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1.6px;
}


.kpi-number {

    margin-top: 17px;

    color: #f5f7fa;

    font-size: 46px;

    line-height: .95;

    letter-spacing: -2.5px;

    font-weight: 800;
}


.kpi-card.primary .kpi-number {

    font-size: 56px;

    color: #ffffff;
}


.kpi-card p {

    margin-top: 13px;

    color: var(--text-muted);

    font-size: 11px;
}


.kpi-symbol {

    display: flex;

    flex-direction: column;

    gap: 3px;
}


.kpi-symbol span {

    width: 19px;
    height: 3px;

    border-radius: 20px;

    background: var(--blue);
}


.kpi-symbol span:nth-child(2) {
    width: 14px;
    opacity: .7;
}

.kpi-symbol span:nth-child(3) {
    width: 9px;
    opacity: .45;
}


.kpi-card.corrective .kpi-header span {
    color: #c48143;
}

.kpi-card.change .kpi-header span {
    color: #9a78cc;
}

.kpi-card.access .kpi-header span {
    color: #d76c79;
}


/* ============================================================
   UNNY
   ============================================================ */

.unny-card {

    margin-top: 18px;

    min-height: 96px;

    padding: 22px 26px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border: 1px solid rgba(22,133,245,.18);

    border-radius: 20px;

    background:
        linear-gradient(
            110deg,
            rgba(7,14,21,.96),
            rgba(8,13,19,.8)
        );
}


.unny-card .section-label {
    margin-bottom: 5px;
}


.unny-card h3 {

    font-size: 18px;

    letter-spacing: -.4px;
}


.unny-total {

    display: flex;

    align-items: baseline;

    gap: 8px;
}


.unny-total strong {

    font-size: 40px;

    letter-spacing: -2px;

    font-weight: 800;
}


.unny-total span {

    color: var(--text-muted);

    font-size: 12px;
}


/* ============================================================
   GRÁFICOS
   ============================================================ */

.charts-grid {

    margin-top: 18px;

    display: grid;

    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(330px, .85fr);

    gap: 18px;

    align-items: stretch;
}


.chart-card {

    min-width: 0;

    padding: 26px;

    border: 1px solid var(--border);

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #090f16,
            #070c12
        );

    box-shadow: var(--shadow);
}


.chart-header {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.chart-header h3 {

    font-size: 19px;

    font-weight: 700;

    letter-spacing: -.5px;
}


.chart-header button {

    flex-shrink: 0;

    padding: 8px 13px;

    border: 1px solid var(--border);

    border-radius: 10px;

    background: #0b1118;

    color: #8495a9;

    font-size: 10px;

    cursor: pointer;

    transition: .2s ease;
}


.chart-header button:hover {

    color: white;

    border-color: rgba(22,133,245,.4);

    background: #0e1720;
}


/* ============================================================
   GRÁFICO DE CIDADES
   ============================================================ */

.city-chart-wrapper {

    position: relative;

    width: 100%;

    height: 510px;

    padding-top: 5px;
}


.city-chart-wrapper canvas {

    width: 100% !important;

    height: 100% !important;
}


/* ============================================================
   DONUT
   ============================================================ */

.donut-area {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    min-height: 470px;
}


.donut-wrapper {

    position: relative;

    width: 270px;
    height: 270px;
}


.donut-wrapper canvas {

    width: 100% !important;
    height: 100% !important;
}


.donut-center {

    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    pointer-events: none;
}


.donut-center strong {

    font-size: 40px;

    line-height: 1;

    letter-spacing: -2px;
}


.donut-center span {

    margin-top: 5px;

    color: var(--text-muted);

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 1px;
}


.type-legend {

    width: 100%;

    margin-top: 25px;

    display: flex;

    flex-direction: column;

    gap: 2px;
}


.legend-item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 11px 2px;

    border-bottom: 1px solid rgba(255,255,255,.045);
}


.legend-left {

    display: flex;

    align-items: center;

    gap: 9px;
}


.legend-dot {

    width: 9px;
    height: 9px;

    border-radius: 50%;
}


.legend-name {

    color: #b8c3d0;

    font-size: 12px;
}


.legend-value {

    color: #f3f6f9;

    font-size: 12px;

    font-weight: 700;
}


/* ============================================================
   TABELA
   ============================================================ */

.table-card {

    margin-top: 18px;

    padding: 26px;

    border: 1px solid var(--border);

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #090f16,
            #070c12
        );

    overflow: hidden;
}


.table-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.table-header h3 {

    font-size: 19px;

    letter-spacing: -.5px;
}


.search-box {

    width: 230px;

    height: 40px;

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 0 12px;

    border: 1px solid var(--border);

    border-radius: 11px;

    background: #0a1017;
}


.search-box svg {

    width: 15px;
    height: 15px;

    fill: none;

    stroke: #5e6e80;

    stroke-width: 2;
}


.search-box input {

    width: 100%;

    border: 0;

    outline: 0;

    background: transparent;

    color: white;

    font-size: 11px;
}


.search-box input::placeholder {
    color: #566577;
}


.table-wrapper {

    width: 100%;

    overflow-x: auto;

    scrollbar-width: thin;
}


table {

    width: 100%;

    border-collapse: separate;

    border-spacing: 0 6px;

    min-width: 800px;
}


thead th {

    padding: 0 16px 8px;

    color: #627991;

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 1.3px;

    text-align: center;
}


thead th:first-child {
    text-align: left;
}


tbody tr {

    background: rgba(255,255,255,.018);

    transition: .2s ease;
}


tbody tr:hover {

    background: rgba(22,133,245,.055);
}


tbody td {

    padding: 13px 16px;

    color: #bdc8d5;

    font-size: 12px;

    text-align: center;

    border-top: 1px solid rgba(255,255,255,.025);

    border-bottom: 1px solid rgba(255,255,255,.025);
}


tbody td:first-child {

    text-align: left;

    color: #f2f5f8;

    font-weight: 700;

    border-left: 1px solid rgba(255,255,255,.025);

    border-radius: 11px 0 0 11px;
}


tbody td:last-child {

    border-right: 1px solid rgba(255,255,255,.025);

    border-radius: 0 11px 11px 0;
}


.total-badge {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 34px;
    height: 30px;

    padding: 0 8px;

    border: 1px solid rgba(22,133,245,.3);

    border-radius: 9px;

    background: rgba(22,133,245,.055);

    color: white;

    font-weight: 800;
}


/* ============================================================
   FOOTER
   ============================================================ */

footer {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 25px 4px 0;

    color: #465466;

    font-size: 10px;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #060a0f;
}

::-webkit-scrollbar-thumb {

    background: #182330;

    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #263547;
}


/* ============================================================
   ANIMAÇÕES
   ============================================================ */

.kpi-card,
.chart-card,
.unny-card,
.hero-card,
.filters-card,
.table-card {

    animation: fadeUp .55s ease both;
}


@keyframes fadeUp {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 1100px) {

    .topbar,
    .content {
        width: min(100% - 36px, 1000px);
    }


    .kpi-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }


    .kpi-card.primary {
        grid-column: span 2;
    }


    .charts-grid {

        grid-template-columns: 1fr;
    }


    .category-card {
        min-height: auto;
    }


    .donut-area {

        min-height: 0;

        padding: 20px 0 5px;
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {

    body {
        overflow-x: hidden;
    }


    .topbar {

        width: calc(100% - 28px);

        min-height: 76px;

        padding: 10px 0;
    }


    .update-area {

        width: 100%;

        justify-content: center;
    }


    .brand-logo {

        width: 105px;

        height: 48px;
    }


    .brand-line {
        height: 26px;
    }


    .brand-name {

        font-size: 10px;

        flex-direction: column;

        align-items: flex-start;

        gap: 1px;
    }


    .update-area {

        gap: 7px;
    }


    .update-area small {
        font-size: 9px;
    }


    .update-area strong {
        font-size: 10px;
    }


    .content {

        width: calc(100% - 20px);

        padding-top: 14px;
        padding-bottom: 40px;
    }


    .hero-card {

        padding: 28px 22px;

        border-radius: 19px;
    }


    .hero-card h1 {

        font-size: 40px;

        letter-spacing: -2px;
    }


    .hero-card h2 {

        margin-top: 18px;

        font-size: 17px;
    }


    .hero-card p {

        font-size: 12px;

        line-height: 1.6;
    }


    .filters-card {

        grid-template-columns: 1fr;

        gap: 16px;

        padding: 17px;

        border-radius: 18px;
    }


    .filters {

        grid-template-columns: 1fr;

        gap: 11px;
    }


    .filter-title {

        flex-direction: row;

        align-items: center;

        justify-content: space-between;
    }


    .kpi-grid {

        grid-template-columns: 1fr 1fr;

        gap: 10px;
    }


    .kpi-card.primary {

        grid-column: span 2;
    }


    .kpi-card {

        min-height: 137px;

        padding: 18px;

        border-radius: 17px;
    }


    .kpi-number {

        font-size: 38px;

        margin-top: 15px;
    }


    .kpi-card.primary .kpi-number {

        font-size: 52px;
    }


    .kpi-card p {

        font-size: 9px;

        line-height: 1.4;
    }


    .kpi-header span {

        font-size: 8px;

        letter-spacing: 1.2px;
    }


    .unny-card {

        padding: 19px;

        min-height: 82px;

        border-radius: 17px;
    }


    .unny-card h3 {

        font-size: 15px;
    }


    .unny-total strong {

        font-size: 34px;
    }


    .charts-grid {

        grid-template-columns: 1fr;

        gap: 12px;
    }


    .chart-card {

        padding: 20px 16px;

        border-radius: 18px;
    }


    .chart-header {

        margin-bottom: 16px;
    }


    .chart-header h3 {

        font-size: 17px;
    }


    .chart-header button {

        font-size: 9px;

        padding: 7px 10px;
    }


    /*
        IMPORTANTE:
        O gráfico continua horizontal no celular.
        Aumentamos a altura para que cada cidade
        tenha espaço próprio.
    */

    .city-chart-wrapper {

        height: 590px;

        width: 100%;
    }


    .donut-wrapper {

        width: 235px;
        height: 235px;
    }


    .donut-area {

        padding-top: 10px;
    }


    .table-card {

        padding: 20px 14px;

        border-radius: 18px;
    }


    .table-header {

        align-items: flex-start;

        flex-direction: column;

        margin-bottom: 14px;
    }


    .search-box {

        width: 100%;
    }


    table {
        min-width: 730px;
    }


    footer {

        flex-direction: column;

        align-items: flex-start;

        font-size: 9px;
    }

}


/* ============================================================
   CELULARES PEQUENOS
   ============================================================ */

@media (max-width: 390px) {

    .brand-name {
        display: none;
    }


    .brand-line {
        display: none;
    }


    .hero-card h1 {
        font-size: 35px;
    }


    .kpi-grid {
        gap: 8px;
    }


    .kpi-card {
        padding: 15px;
    }


    .kpi-number {
        font-size: 34px;
    }


    .kpi-card.primary .kpi-number {
        font-size: 48px;
    }


    .city-chart-wrapper {
        height: 610px;
    }

}