/* Seção de Arquivos */
.arquivos {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

/* Alertas */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.alert-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

/* Filtros */
.filtros {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.filtros h2 {
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 20px;
    font-weight: 600;
}

.filtros form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.botoes-filtro {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    margin-top: 10px;
    justify-content: flex-start;
}

.filtro-group {
    display: flex;
    flex-direction: column;
}

.filtro-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.filtros select,
.filtros input[type="text"] {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.filtros select:focus,
.filtros input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-filtrar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    height: fit-content;
    width: fit-content;
}

.btn-filtrar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-limpar {
    background: #fff;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    height: fit-content;
    width: fit-content;
}

.btn-limpar:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Registros por página */
.registros-por-pagina {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.registros-por-pagina label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.registros-por-pagina select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* Filtros ativos */
.filtros-ativos {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #065f46;
}

/* Info paginação */
.info-paginacao {
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

/* Tabela */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 14px;
    letter-spacing: 0.5px;
}

table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: #f8fafc;
}

table tbody tr:last-child {
    border-bottom: none;
}

table td {
    padding: 14px 12px;
    color: #374151;
    font-size: 14px;
    vertical-align: middle;
}

/* Botões da tabela */
.download-btn,
.edit-btn,
.delete-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
    transition: all 0.2s ease;
}

.download-btn {
    background: #10b981;
    color: white;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.edit-btn {
    background: #f59e0b;
    color: white;
}

.edit-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.acoes {
    white-space: nowrap;
}

/* Paginação */
.paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.paginacao a,
.paginacao span {
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.paginacao a {
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: white;
}

.paginacao a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.paginacao span.ativo {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: 1px solid #667eea;
}

.paginacao span.desabilitado {
    color: #cbd5e1;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

/* Estado vazio */
.no-files {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-files p {
    font-size: 16px;
    margin-bottom: 16px;
}

.no-files a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.no-files a:hover {
    text-decoration: underline;
}

/* Responsividade para tabela */
@media screen and (max-width: 1024px) {
    .arquivos {
        padding: 24px;
        margin: 20px 16px;
    }

    .filtros form {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    table tbody tr:hover {
        background-color: #f8fafc;
    }

    table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 8px;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    table td:last-child {
        border-bottom: none;
    }

    table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        text-align: left;
        margin-right: 12px;
        flex: 1;
    }

    .paginacao {
        gap: 6px;
    }

    .paginacao a,
    .paginacao span {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media screen and (max-width: 768px) {
    .arquivos {
        padding: 20px 16px;
        margin: 16px 12px;
    }

    .filtros {
        padding: 20px;
    }

    .filtros form {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .botoes-filtro {
        flex-direction: column;
        gap: 10px;
    }

    .btn-filtrar,
    .btn-limpar {
        width: 100%;
        text-align: center;
    }

    .registros-por-pagina {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .paginacao {
        flex-wrap: wrap;
        gap: 4px;
    }

    .paginacao a,
    .paginacao span {
        padding: 6px 10px;
        font-size: 12px;
        margin-bottom: 4px;
    }
}

@media screen and (max-width: 480px) {
    .arquivos {
        padding: 16px 12px;
        margin: 12px 8px;
        border-radius: 12px;
    }

    .filtros {
        padding: 16px;
    }

    .filtros h2 {
        font-size: 16px;
    }

    table td {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 6px;
    }

    table td::before {
        margin-right: 0;
        margin-bottom: 4px;
        font-size: 13px;
    }

    .info-paginacao {
        font-size: 13px;
        padding: 10px 12px;
    }

    .paginacao {
        justify-content: center;
    }

    .paginacao a:first-child,
    .paginacao a:last-child,
    .paginacao span:first-child,
    .paginacao span:last-child {
        display: none;
    }
}

/* Adicionar labels para células da tabela em mobile */
@media screen and (max-width: 1024px) {
    table td {
        data-label: attr(data-label);
    }

    table td:nth-child(1)::before {
        content: "Nome: ";
    }

    table td:nth-child(2)::before {
        content: "Tipo: ";
    }

    table td:nth-child(3)::before {
        content: "Categoria: ";
    }

    table td:nth-child(4)::before {
        content: "Identificador: ";
    }

    table td:nth-child(5)::before {
        content: "Mês: ";
    }

    table td:nth-child(6)::before {
        content: "Ano: ";
    }

    table td:nth-child(7)::before {
        content: "Download: ";
    }
}