    /* ===== LAYOUT ===== */

    body {
        background: #f4f6fb;
        font-family: 'Segoe UI', sans-serif;
    }

    .wrapper {
        display: flex;
        width: 100%;
    }

    /* ===== SIDEBAR ===== */

    #sidebar {
        width: 240px;
        min-height: 100vh;
        background: linear-gradient(180deg, #217556, #174f3c);
        color: white;
        transition: all .3s;
    }

    #sidebar.collapsed {
        width: 70px;
    }

    #sidebar.collapsed .menu-text {
        display: none;
    }

    #sidebar.collapsed .sidebar-header h5 {
        display: none;
    }

    #sidebar .sidebar-header {
        padding: 20px;
        background: #0f3b2d;
        text-align: center;
    }

    #sidebar ul {
        padding: 0;
        list-style: none;
        margin: 0;
    }

    #sidebar ul li {
        padding: 12px 15px;
    }

    #sidebar ul li a {
        color: #d1d5db;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 15px;
    }

    #sidebar ul li a:hover {
        background: #2f8a66;
        color: white;
        border-radius: 6px;
    }

    .kpi-5 {
        background: linear-gradient(135deg, #0ea5a4, #0f766e);
        color: #fff;
    }

  /* ===== ESCALA ===== */

.tabela-escala {
    font-size: 12px;
    border-radius: 10px;
    min-width: 900px;
}

/* container com scroll */
.table-responsive {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

/* header fixo */
.tabela-escala thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    border: none;
}

/* primeira coluna fixa */
.tabela-escala td:first-child {
    text-align: left;
    font-weight: 600;
    background: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* células */
.tabela-escala td {
    text-align: center;
    padding: 6px;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tabela-escala tbody tr:hover {
    background: #f1f5ff;
}

.tabela-escala td:hover {
    transform: scale(1.05);
    z-index: 1;
    position: relative;
}

.select2-container--default .select2-selection--multiple {
    min-height: 38px;
    border-radius: 8px;
    border: 1px solid #ced4da;
}

.select2-selection__choice {
    background-color: #198754 !important;
    color: #fff !important;
    border: none !important;
}

/* 🔥 trava largura da tabela */
#tabela {
    width: 100% !important;
}

/* 🔥 corrige o wrapper do DataTables */
.dataTables_wrapper {
    width: 100% !important;
    overflow-x: auto;
}

/* 🔥 evita estouro */
.table-responsive {
    overflow-x: auto;
}

/* 🔥 impede colunas gigantes */
#tabela th, #tabela td {
    white-space: nowrap;
}
.tabela-escala .trabalhou {
    background: #ffffff;
    color: #000; /* texto normal */
    font-weight: 500;
}

/* 🔥 só o ícone verde */
.tabela-escala .trabalhou i {
    color: #198754;
}

.suspensao {
    background-color: #dc3545;
    color: #fff;
    font-weight: bold;
}

.linha-detalhe td {
    background: #f8f9fa;
}

.box-detalhe {
    padding: 15px;
    background: white;
    border-radius: 8px;
}

/* Folga */
.tabela-escala .folga {
    background: #fff1f2;
    color: #b02a37;
    font-weight: 500;
}

/* Falta */
.tabela-escala .falta {
    background: #fff8e1;
    color: #8a6d00;
    font-weight: 500;
}

.tabela-escala .justificado {
    background: #eef6ff;
    color: #1e40af;
    font-weight: 500;
}

.tabela-escala .feriado {
    background: #fff8db;
    color: #997404;
    border: 1px solid #ffe58f;
    font-weight: 600;
}

.tabela-escala .neutro {
    background: #f8f9fa;
    color: #6c757d;
}

    #loading {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.85);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 9999;
    }

    .user-box {
        background: #1f6f54;
        color: #fff;
    }

    .user-box small {
        color: #cfd8dc;
    }

    #fullscreenBtn {
        opacity: 0.6;
        transition: 0.2s;
    }

    #fullscreenBtn:hover {
        opacity: 1;
        transform: scale(1.1);
    }

    .kpi-card {
        border-radius: 12px;
        padding: 20px;
        color: #fff;
    }

    .kpi-azul {
        background: linear-gradient(135deg, #4e73df, #224abe);
    }

    .kpi-verde {
        background: linear-gradient(135deg, #1cc88a, #169b6b);
    }

    .kpi-laranja {
        background: linear-gradient(135deg, #f6c23e, #dda20a);
    }

    .kpi-roxo {
        background: linear-gradient(135deg, #6f42c1, #4e2aa3);
    }

    .fullscreen {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999;
        background: #fff;
        padding: 10px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .fullscreen .card-body {
        height: calc(100vh - 80px);
        overflow: auto;
    }

    .fullscreen .table-responsive {
        flex: 1;
        overflow: hidden;
    }

    .fullscreen .dataTables_scrollBody {
        max-height: 100% !important;
    }

    .loading-box {
        text-align: center;
    }

    #tabela th {
        text-align: center;
    }

    #tabela td {
        text-align: center;
    }

    #tabela td:first-child {
        font-weight: bold;
        text-align: left;
    }

    .loading-box p {
        margin-top: 10px;
        font-weight: 600;
    }


    #sidebar ul li a:hover {
        background: #307c4f;
        color: white;
        border-radius: 6px;
    }

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

    #content {
        width: 100%;
        min-height: 100vh;
        transition: all .3s;
    }

    /* ===== NAVBAR ===== */

    .topbar {
        background: white;
        padding: 10px 20px;
        box-shadow: 0 2px 10px rgba(52, 150, 83, 0.05);
    }

    /* ===== KPI COMPACTO AJUSTADO ===== */

    .kpi-card {
        padding: 11px !important;
        /* +1 */
        border-radius: 10px;
        min-height: 72px;
        /* um pouquinho maior */
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        color: white;
        transition: all 0.2s ease;
    }

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }


    .kpi-title {
        font-size: 12.5px;
        margin-bottom: 4px;
        opacity: 0.9;
    }

    /* valor */
    .kpi-value {
        font-size: 19px;
        font-weight: 700;
    }

    .kpi-card {
        height: 90px;

    }

    .kpi-1 {
        background: linear-gradient(135deg, #4f46e5, #6366f1);
    }

    .kpi-2 {
        background: linear-gradient(135deg, #059669, #10b981);
    }

    .kpi-3 {
        background: linear-gradient(135deg, #d97706, #f59e0b);
    }

    .kpi-4 {
        background: linear-gradient(135deg, #dc2626, #ef4444);
    }

    /* espaçamento */
    #kpiContainer .col-md-3 {
        padding: 6px;
        /* antes 4px */
    }

    /* ===== FILTRO ===== */

    .filtro-box {
        background: white;
        border-radius: 10px;
        padding: 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
    }

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

    @media(max-width:768px) {

        #sidebar {
            position: fixed;
            left: -240px;
            z-index: 1000;
        }

        #sidebar.active {
            left: 0;
        }

        #sidebar.collapsed {
            width: 240px;
        }

        #sidebar.collapsed .menu-text {
            display: inline;
        }

    }