/* ==========================================
   CONFIGURAÇÕES GERAIS
   ========================================== */
body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    margin: 0;
    padding: 20px;
    color: #333;
}

/* ==========================================
   NAVEGAÇÃO (ABAS DE VISÃO)
   ========================================== */
.view-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #cbd5e1;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

/* ==========================================
   FILTROS E HEADER
   ========================================== */
.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filters-left {
    display: flex;
    gap: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group select {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    outline: none;
}

.sync-info {
    font-size: 12px;
    color: #888;
}

#sync-time {
    color: #28a745;
    font-weight: bold;
}

/* ==========================================
   TABELA E LINHAS (CARDS)
   ========================================== */
.table-header,
.row-card {
    display: grid;
    /* Grid sincronizada: Consultor, Função, Status, Progresso, Horário */
    grid-template-columns: 2fr 1fr 1fr 2.5fr 1fr;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
}

.table-header {
    color: #888;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.row-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
}

.row-card:hover {
    background: #fdfdfd;
}

/* Elementos Internos do Card */
.col-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.op-name {
    font-weight: 600;
    color: #333;
}

.col-role {
    color: #666;
    font-size: 13px;
}

.col-change {
    text-align: right;
    font-weight: 600;
    color: #444;
}

/* Badges de Status */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    color: white;
    text-align: center;
    width: 85px;
}

.online {
    background: #28a745;
}

.busy {
    background: #dc3545;
}

.warning {
    background: #ffc107;
    color: #000;
}

.offline {
    background: #6c757d;
}

.badge-sabado {
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: bold;
    margin-left: 5px;
    text-transform: uppercase;
}

.badge-sabado.past {
    background-color: #94a3b8;
    /* Cinza slate */
    opacity: 0.7;
}

/* 🟢 Verde: É o plantão desta semana */
.badge-sabado.active {
    background-color: #22c55e;
    /* Verde original */
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* 🔵 Azul: Sábados futuros no mês */
.badge-sabado.future {
    background-color: #3b82f6;
    /* Azul vibrante */
}

/* ==========================================
   BARRAS DE PROGRESSO
   ========================================== */
.progress-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

.progress-fill.green {
    background: #28a745 !important;
}

.progress-fill.yellow {
    background: #ffc107 !important;
}

.progress-fill.red {
    background: #dc3545 !important;
}

.progress-fill.exceeded {
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        background-color: #dc3545;
    }

    50% {
        background-color: #721c24;
    }

    100% {
        background-color: #dc3545;
    }
}

/* Fundo escuro atrás do modal */
.modal {
    display: none;
    /* Escondido por padrão */
    position: fixed;
    z-index: 9999;
    /* Garante que fica no topo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Preto com transparência */
    backdrop-filter: blur(5px);
    /* Efeito de desfoque no fundo */
    justify-content: center;
    align-items: center;
}

/* A caixa branca/escura do modal */
.modal-content {
    background-color: #1e293b;
    /* Cor do seu dashboard */
    color: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    /* Scroll se tiver muitos sábados */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
}

/* Organização dos slots em grade */
.slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.slot-card {
    background: #0f172a;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #334155;
}

.select-escala {
    width: 100%;
    height: 120px;
    /* Altura para ver vários operadores */
    background: #1e293b;
    color: white;
    border: 1px solid #475569;
    border-radius: 5px;
    margin-top: 10px;
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 5px solid #3b82f6;
    /* Azul por padrão */
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Botão de Limpar no Modal */
.btn-clear {
    background: none;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #fee2e2;
    color: #dc3545;
    border-color: #fca5a5;
}