    /* ===== 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;
}

.folga-trabalhada {
    background: #0dcaf0 !important;
    color: #fff !important;
    font-weight: bold;
}


/* 🔥 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);
    }


    /* =========================
   LIGHT
========================= */

body {
    background: #f4f6f9;
    color: #222;
    transition: 0.3s;
}

.card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.topbar {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

#sidebar {
    background: #1f6f54;
    color: #fff;
}

#sidebar a {
    color: #ddd;
}

/* =========================
   DARK MODE
========================= */

body.dark-mode {
    background: #0f172a;
    color: #f1f5f9;
}

/* cards */

body.dark-mode .card,
body.dark-mode .topbar,
body.dark-mode .filtro-box,
body.dark-mode .modal-content {
    background: #1e293b !important;
    color: #337a5a !important;
    border: 1px solid #334155;
}

/* inputs */

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #0f172a;
    color: #fff;
    border: 1px solid #334155;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: #0f172a;
    color: #fff;
    border-color: #22c55e;
    box-shadow: none;
}

/* tabela */

body.dark-mode table {
    color: #6a1b95;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
    background: #162033;
    color: #fff;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(even) > * {
    background: #1e293b;
    color: #fff;
}

body.dark-mode table.dataTable thead {
    background: #111827;
    color: #fff;
}

/* sidebar */

body.dark-mode #sidebar {
    background: #020617;
}

body.dark-mode #sidebar a {
    color: #cbd5e1;
}

body.dark-mode #sidebar li.active {
    background: #1e293b;
}

/* KPI */

body.dark-mode .kpi-card {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
}

/* DataTables */

body.dark-mode .dataTables_wrapper {
    color: #fff;
}

body.dark-mode .dataTables_filter input,
body.dark-mode .dataTables_length select {
    background: #0f172a;
    color: #fff;
    border: 1px solid #334155;
}

/* =========================
   BOTÃO DARK MODE
========================= */

.theme-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #666;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.theme-btn:hover {
    background: rgba(0,0,0,0.08);
    color: #000;
}

body.dark-mode .theme-btn {
    color: #cbd5e1;
}

body.dark-mode .theme-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}





/* ===================================
   🌙 DARK MODE - ESCALA
=================================== */

body.dark-mode .tabela-escala {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #1e293b;
}

/* HEADER */

body.dark-mode .tabela-escala thead th {
    background: #1e3a8a !important;
    color: #fff !important;
    border: 1px solid #334155 !important;
    vertical-align: middle;
}

/* TD */

body.dark-mode .tabela-escala td {
    background: #111827;
    color: #e5e7eb;
    border: 1px solid #1e293b !important;
    transition: 0.2s;
}

/* hover */

body.dark-mode .tabela-escala tbody tr:hover td {
    background: #172033;
}

/* primeira coluna */

body.dark-mode .tabela-escala td:first-child {
    background: #0b1220;
}

/* detalhes */

body.dark-mode .linha-detalhe td {
    background: #020617 !important;
}

/* ===================================
   STATUS
=================================== */

/* trabalhou */

body.dark-mode .trabalhou {
    background: rgba(34,197,94,0.12) !important;
    color: #4ade80 !important;
}

/* folga */

body.dark-mode .folga {
    background: rgba(244,63,94,0.10) !important;
    color: #fb7185 !important;
}

/* falta */

body.dark-mode .falta {
    background: rgba(239,68,68,0.12) !important;
    color: #f87171 !important;
}

/* suspensão */

body.dark-mode .suspensao {
    background: rgba(251,191,36,0.14) !important;
    color: #facc15 !important;
}

/* férias */

body.dark-mode .ferias {
    background: rgba(59,130,246,0.12) !important;
    color: #60a5fa !important;
}

/* licença */

body.dark-mode .licenca {
    background: rgba(168,85,247,0.12) !important;
    color: #d8b4fe !important;
}

/* feriado */

body.dark-mode .feriado {
    background: rgba(14,165,233,0.12) !important;
    color: #38bdf8 !important;
}

/* justificado */

body.dark-mode .justificado {
    background: rgba(16,185,129,0.12) !important;
    color: #34d399 !important;
}

/* extra folga */

body.dark-mode .extra-folga {
    background: rgba(245,158,11,0.12) !important;
    color: #fbbf24 !important;
}

/* neutro */

body.dark-mode .neutro {
    background: #0f172a !important;
    color: #64748b !important;
}



/* botão */

#toggleTheme {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

    /* ===== 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;
        }

    }