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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8fafc;
    color: #000;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
}

.company-name-tooltip {
    position: fixed;
    z-index: 5000;
    max-width: min(78vw, 320px);
    padding: 6px 8px;
    border-radius: 8px;
    background-color: rgba(15, 23, 42, 0.96);
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.company-name-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

#filter-empresa {
    background-color: transparent;
    border: 1px solid transparent;
    color: #475569;
    height: 30px;
    width: 30px;
    padding: 0;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

#filter-empresa:focus {
    width: 200px;
    background-color: #ffffff;
    border: 1px solid #22c55e;
    background-position: 8px center;
    padding: 0 10px 0 30px;
    cursor: text;
}

.varejo-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    border-spacing: 0;
}

.varejo-table th {
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 10px;
    vertical-align: middle;
    border-bottom: 2px solid #e2e8f0;
}

.col-empresa {
    text-align: left !important;
    width: 30%;
}

.col-info {
    width: 15%;
    font-size: 0.7rem !important;
}

.col-group-header {
    border-bottom: 1px solid #cbd5e1 !important;
    padding-bottom: 5px;
}

.col-score {
    width: 100px;
}

.rotated-text {
    height: 140px;
    white-space: nowrap;
}

.rotated-text div {
    transform: rotate(-90deg);
    width: 30px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    transform-origin: center;
    position: relative;
    left: 10px;
}

.rotated-text span {
    display: inline-block;
    padding: 0 5px;
}

.varejo-table td {
    padding: 12px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    font-weight: 700;
}

.varejo-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.cell-empresa {
    text-align: left;
    text-transform: uppercase;
}

.cell-info {
    text-align: center;
}

.info-icon {
    display: inline-block;
    width: 30px;
    height: 15px;
    background-color: #64748b;
    border-radius: 10px;
}

.info-icon-plena {
    background-color: #2563eb;
}

.cell-score {
    text-align: center;
}

.score-capsule {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-weight: 700;
    min-width: 40px;
}

.bg-green-dark {
    background-color: #15803d;
}

.bg-green {
    background-color: #22c55e;
}

.bg-yellow {
    background-color: #facc15;
    color: #111827;
}

.bg-orange {
    background-color: #f97316;
}

.bg-red {
    background-color: #ef4444;
}

.bg-gray {
    background-color: #94a3b8;
}

@media (max-width: 1024px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 14px;
    }

    .varejo-table {
        min-width: 740px;
    }

    #filter-empresa:focus {
        width: 170px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 10px;
    }

    .varejo-table {
        min-width: 700px;
    }

    .varejo-table th {
        font-size: 0.72rem;
        padding: 8px;
    }

    .varejo-table td {
        font-size: 0.8rem;
        padding: 10px 8px;
    }

    .rotated-text {
        height: 118px;
    }

}

@media (max-width: 640px) {
    .varejo-table {
        min-width: 520px;
        table-layout: fixed;
    }

    .rotated-text div {
        gap: 1px;
        line-height: 1;
    }

    .rotated-text span {
        display: block;
        padding: 0;
        line-height: 1;
    }

    .rotated-text br {
        display: none;
    }

    .varejo-table thead tr:nth-child(2) th.rotated-text:nth-child(2) div,
    .varejo-table thead tr:nth-child(2) th.rotated-text:nth-child(3) div {
        left: 0;
    }

    .col-empresa {
        width: 24%;
    }

    .col-info,
    .cell-info {
        display: none;
    }

    .col-score {
        width: 82px;
    }

    .col-group-header {
        text-align: center !important;
        font-size: 0.66rem !important;
        line-height: 1.1;
        letter-spacing: 0;
        white-space: normal;
        padding: 0 2px 6px;
        position: relative;
        left: -4px;
    }

    .varejo-table tbody td:nth-child(4) .score-capsule,
    .varejo-table tbody td:nth-child(5) .score-capsule {
        transform: translateX(-10px);
    }

    .cell-empresa {
        max-width: 110px;
        font-size: 0.68rem;
        line-height: 1.1;
        padding-left: 6px;
        padding-right: 4px;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .varejo-table {
        min-width: 480px;
    }

    #filter-empresa:focus {
        width: 140px;
    }

    .score-capsule {
        min-width: 36px;
        padding: 5px 9px;
    }

}
