/* ============================================
   PÁGINA DE ADMINISTRAÇÃO
   ============================================ */

/* Métrica Box */
.metric-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Variação de cores para as métricas */
.metric-box:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.2);
}

.metric-box:nth-child(2):hover {
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.3);
}

.metric-box:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}

.metric-box:nth-child(3):hover {
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.3);
}

/* Tabela de Usuários/Logs */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 8px !important;
    height: 50px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    height: 50px;
}

.table tbody tr td {
    padding: 8px 12px !important;
    vertical-align: middle;
    font-size: 0.9rem;
    line-height: 1.2;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
    box-shadow: inset 0 0 0 1px #e9ecef;
}

/* Status Badge Online/Offline */
.status-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-badge.online {
    background-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.status-badge.offline {
    background-color: #6c757d;
    box-shadow: none;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.8);
    }
}

/* Badges de Permissão */
.badge-permissao {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background-color: #dc3545;
    color: white;
}

.badge-gestor {
    background-color: #007bff;
    color: white;
}

.badge-usuario {
    background-color: #6c757d;
    color: white;
}

.badge-consulta {
    background-color: #17a2b8;
    color: white;
}

/* Badges de Tipo de Log */
.badge-log {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-log-login {
    background-color: #28a745;
    color: white;
}

.badge-log-logout {
    background-color: #ffc107;
    color: #333;
}

.badge-log-create {
    background-color: #17a2b8;
    color: white;
}

.badge-log-update {
    background-color: #007bff;
    color: white;
}

.badge-log-delete {
    background-color: #dc3545;
    color: white;
}

.badge-log-change-password {
    background-color: #6f42c1;
    color: white;
}

/* Abas */
.nav-tabs .nav-link {
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

.nav-tabs .nav-link.active {
    color: #667eea;
    background-color: transparent;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.nav-tabs {
    border-bottom: 1px solid #e9ecef;
}

/* Card Admin */
.card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
}

.card-header {
    padding: 1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Filtro de Logs */
.input-group-sm .form-select {
    border: 1px solid #e0e0e0;
    border-radius: 0.375rem;
    height: 2.25rem;
}

.input-group-sm .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Página Header */
.page-header {
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.page-header h1 {
    color: #2c3e50;
    font-weight: 700;
}

.page-subtitle {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Tempo de Conexão */
.tempo-conexao {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

/* Responsivo */
@media (max-width: 768px) {
    .metric-box {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .nav-tabs .nav-link {
        font-size: 0.9rem;
    }

    .input-group-sm {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 1rem;
    }
}
