/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container principal considerando o menu */
.container {
    margin-left: 250px; /* Espaço para menu lateral */
    padding: 30px;
    min-height: 100vh;
    background-color: #f5f7fa;
    transition: margin-left 0.3s ease;
}

/* Responsividade do container para menu colapsado */
@media (max-width: 1024px) {
    .container {
        margin-left: 80px; /* Menu colapsado */
    }
}

@media (max-width: 768px) {
    .container {
        margin-left: 0; /* Menu overlay em mobile */
        padding: 20px;
    }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcb900;
    padding: 25px 35px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecf1;
}

.header h1 {
    font-size: 2.2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* Botão Novo Usuário */
.btn-novo {
    background: black;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95em;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-novo:hover {
    background: #2563eb;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.btn-novo:active {
    transform: translateY(0);
}

/* Barra de pesquisa */
.search-bar {
    display: flex;
    gap: 15px;
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecf1;
}

.search-input, .filter-select {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.2s ease;
    background: white;
    color: #374151;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: #9ca3af;
}

.filter-select {
    cursor: pointer;
    min-width: 180px;
}

/* Wrapper da tabela */
.table-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecf1;
    overflow: hidden;
}

/* Tabela */
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.user-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e8ecf1;
}

.user-table th {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.9em;
    text-align: left;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.user-table tbody tr:hover {
    background-color: #f8fafc;
}

.user-table tbody tr:last-child {
    border-bottom: none;
}

.user-table td {
    padding: 16px 20px;
    color: #4b5563;
    vertical-align: middle;
}

/* Coluna de ações */
.acoes-coluna {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.btn-acao {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85em;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.btn-acao.editar {
    background: #f59e0b;
    color: white;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.btn-acao.editar:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
}

.btn-acao.excluir {
    background: #ef4444;
    color: white;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.btn-acao.excluir:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

/* Estado vazio */
.user-table tbody tr td[colspan] {
    text-align: center;
    color: #6b7280;
    padding: 40px 20px;
    font-size: 1em;
    background: #f9fafb;
}

/* Tags de tipo de usuário */
.user-table td:nth-child(3) {
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 1200px) {
    .container {
        padding: 25px;
    }
    
    .header {
        padding: 20px 25px;
    }
    
    .search-bar {
        padding: 18px 20px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .search-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-select {
        min-width: auto;
    }
    
    .user-table th,
    .user-table td {
        padding: 12px 16px;
    }
    
    .acoes-coluna {
        flex-direction: column;
        gap: 6px;
    }
    
    .btn-acao {
        padding: 10px 16px;
        font-size: 0.9em;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 640px) {
    /* Tabela responsiva em cards para mobile */
    .table-wrapper {
        box-shadow: none;
        border: none;
        background: transparent;
        border-radius: 0;
    }
    
    .user-table,
    .user-table thead,
    .user-table tbody,
    .user-table th,
    .user-table td,
    .user-table tr {
        display: block;
    }
    
    .user-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .user-table tr {
        background: white;
        border: 1px solid #e8ecf1;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .user-table td {
        border: none;
        position: relative;
        padding: 8px 0 8px 100px !important;
        text-align: left;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .user-table td:last-child {
        border-bottom: none;
        padding-bottom: 0 !important;
    }
    
    .user-table td:before {
        content: attr(data-label) ":";
        position: absolute;
        left: 0;
        width: 90px;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #374151;
        font-size: 0.85em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .acoes-coluna {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
        padding-left: 0 !important;
        margin-top: 10px;
    }
    
    .acoes-coluna:before {
        content: "AÇÕES:";
        position: absolute;
        left: 0;
        width: 90px;
        font-weight: 600;
        color: #374151;
        font-size: 0.85em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}

/* Estados de loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #d1d5db;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animações sutis */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Ajustes para diferentes tamanhos de menu */
@media (min-width: 1440px) {
    .container {
        margin-left: 280px; /* Menu expandido em telas grandes */
    }
}