/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
    --font-size-base: 14px;
    --font-size-large: 16px;
    --card-padding: 0.35rem; /* Reduzido */
    --card-margin: 0.25rem; /* Reduzido */
    --card-min-width: 140px;
    --card-max-width: 200px;
    --card-height: auto;
    --card-min-height: 55px; /* Reduzido de 70px para 55px */
}

/* ===== CONTROLE DE VISIBILIDADE DOS SETORES ===== */
.sector-toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-radius: 50px;
    width: fit-content;
    border: 1px solid #dee2e6;
}

    .sector-toggle-container .form-check {
        margin-bottom: 0;
        margin-left: 0.75rem;
    }

    .sector-toggle-container .form-check-input {
        cursor: pointer;
        width: 2.5rem;
        height: 1.25rem;
    }

    .sector-toggle-container .form-check-label {
        font-weight: 500;
        color: #495057;
    }

.sector-cards-container {
    transition: all 0.3s ease;
}

    .sector-cards-container.hidden {
        display: none;
    }

/* ===== CARDS DE LEGENDA (MAIS COMPACTOS) ===== */
.card-legend {
    padding: 0 !important;
    margin-bottom: var(--card-margin) !important;
    width: 100% !important;
    min-width: 140px;
    height: auto !important;
    min-height: 45px !important; /* Reduzido */
    display: flex;
    align-items: center;
    border: none !important;
}

    .card-legend .card-body {
        padding: 0.4rem 0.5rem !important; /* Reduzido */
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .card-legend .card-title {
        font-size: 0.8rem !important; /* Reduzido */
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 500;
    }

        .card-legend .card-title i {
            flex-shrink: 0;
            font-size: 0.7rem !important;
        }

/* ===== CARDS DE SETOR (MAIS COMPACTOS) ===== */
.card-sector {
    padding: 0 !important;
    margin-bottom: 0.35rem !important; /* Reduzido */
    width: 100% !important;
    min-width: 120px;
    height: auto !important;
    min-height: 50px !important; /* Reduzido */
    border: 1px solid #0d6efd;
    transition: transform 0.15s ease-in-out;
}

    .card-sector .card-body {
        padding: 0.3rem 0.25rem !important; /* Reduzido */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 50px !important; /* Reduzido */
    }

    .card-sector h3 {
        font-size: 1.2rem !important; /* Reduzido */
        margin: 0 0 0.1rem 0;
        font-weight: bold;
        line-height: 1.1;
    }

    .card-sector span {
        font-size: 0.7rem !important; /* Reduzido */
        color: #6c757d;
        text-align: center;
        word-break: break-word;
        line-height: 1.2;
    }

/* ===== CARDS DE TOTAL GERAL (MAIS COMPACTOS) ===== */
.card-total {
    padding: 0 !important;
    margin-bottom: 0.35rem !important; /* Reduzido */
    width: 100% !important;
    min-width: 120px;
    height: auto !important;
    min-height: 50px !important; /* Reduzido */
    border: 2px solid #0d6efd;
}

    .card-total .card-body {
        padding: 0.3rem 0.25rem !important; /* Reduzido */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 50px !important; /* Reduzido */
        background: linear-gradient(135deg, rgba(13,110,253,0.05) 0%, rgba(13,110,253,0.1) 100%);
    }

    .card-total h3 {
        font-size: 1.3rem !important; /* Reduzido */
        margin: 0 0 0.1rem 0;
        font-weight: bold;
        line-height: 1.1;
    }

    .card-total span {
        font-size: 0.7rem !important; /* Reduzido */
        color: #6c757d;
        text-align: center;
        font-weight: 500;
        line-height: 1.2;
    }

/* ===== BADGES DE STATUS NA TABELA ===== */
.status-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.35rem;
}

    .status-badge.yellow {
        background-color: #ffc107;
    }

    .status-badge.red {
        background-color: #dc3545;
    }

    .status-badge.green {
        background-color: #198754;
    }

    .status-badge.blue {
        background-color: #0d6efd;
    }

/* ===== TABELA DE CHAMADOS ===== */
.table-chamados {
    font-size: 0.85rem; /* Reduzido */
    width: 100%;
    
}

    .table-chamados th {
        font-weight: 600;
        white-space: nowrap;
        padding: 0.5rem 0.4rem !important; /* Reduzido */
        font-size: 0.8rem;
        color: white;
        background-color: #3b5998;
        font-weight: 900;
    }

    .table-chamados td {
        padding: 0.5rem 0.4rem !important; /* Reduzido */
        vertical-align: middle;
    }

    /* Detalhes do endereço mais compactos */
    .table-chamados .endereco-detalhes {
        font-size: 0.75rem; /* Reduzido */
    }

        .table-chamados .endereco-detalhes small {
            display: block;
            margin-top: 0.15rem;
            color: #6c757d;
            line-height: 1.2;
        }

        .table-chamados .endereco-detalhes i {
            margin-right: 0.2rem;
            color: #0d6efd;
            font-size: 0.7rem;
        }

/* ===== CONTAINER DA TABELA COM ROLAGEM ===== */
.div-table-content {
    height: 450px; /* Reduzido de 590px */
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-top: 0.75rem;
}

/* ===== AJUSTES RESPONSIVOS ===== */
@media (max-width: 768px) {
    .card-sector h3 {
        font-size: 1.1rem !important;
    }

    .card-total h3 {
        font-size: 1.2rem !important;
    }

    .card-legend .card-title {
        font-size: 0.7rem !important;
        white-space: normal;
    }

    .div-table-content {
        height: 350px; /* Menor em mobile */
    }
}

@media (max-width: 576px) {
    .sector-toggle-container {
        padding: 0.35rem 0.75rem;
    }

        .sector-toggle-container .form-check-label {
            font-size: 0.8rem;
        }

    .card-sector .card-body {
        padding: 0.2rem 0.2rem !important;
        min-height: 45px !important;
    }

    .card-sector h3 {
        font-size: 1rem !important;
    }

    .card-sector span {
        font-size: 0.65rem !important;
    }

    .div-table-content {
        height: 300px;
    }
}
