/* Estrutura base */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 20px;
    margin-top: 80px; /* Espaço para o header fixo */
    min-height: calc(100vh - 80px); /* Altura mínima considerando o header */
}

.settings-card {
    background: rgba(47, 49, 54, 0.7);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Cabeçalho da página */
.page-header {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.page-header h1 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

/* Tabela responsiva */
.table-responsive {
    margin-top: 20px;
    overflow-x: auto;
    background: rgba(26, 27, 30, 0.5);
    border-radius: 8px;
    padding: 15px;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #fff;
}

/* NOVO DESIGN: Tabela de usuários SEM QUEBRAR EM CARDS NO MOBILE */

/* Mantém a tabela como tabela, mas permite rolagem horizontal em telas pequenas */
.table-responsive {
    overflow-x: auto;
    background: rgba(26, 27, 30, 0.5);
    border-radius: 12px;
    padding: 18px 10px;
    box-shadow: 0 2px 12px rgba(0,255,136,0.04);
    margin-top: 24px;
}

.admin-table {
    width: 100%;
    min-width: 700px;
    border-collapse: separate;
    border-spacing: 0;
    color: #fff;
    background: transparent;
    font-size: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,255,136,0.04);
}

.admin-table thead tr {
    background: linear-gradient(90deg, #23272a 60%, #2f3136 100%);
}

.admin-table th, .admin-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.admin-table th {
    color: #00ff88;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-top: none;
    border-bottom: 2px solid #00ff88;
    background: rgba(47,49,54,0.7);
}

.admin-table tbody tr {
    background: rgba(47, 49, 54, 0.92);
    transition: background 0.2s, box-shadow 0.2s;
}

.admin-table tbody tr:hover {
    background: rgba(0,255,136,0.07);
    box-shadow: 0 2px 12px rgba(0,255,136,0.08);
}

.admin-table td {
    vertical-align: middle;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.admin-table td:last-child {
    border-bottom: none;
}

/* Estilos mobile */
@media screen and (max-width: 768px) {
    .settings-grid {
        margin-top: 60px; /* Menor margem em mobile */
        padding: 10px;
    }

    .settings-card {
        padding: 15px;
        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Transformar tabela em cards */
    .admin-table thead {
        display: none;
    }

    .admin-table tbody tr {
        display: flex;
        flex-direction: column;
        background: rgba(47, 49, 54, 0.9);
        margin-bottom: 15px;
        border-radius: 8px;
        padding: 15px;
    }

    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #00ff88;
        flex: 1;
        margin-right: 15px;
    }

    /* Ajustes específicos para cada tipo de dado */
    .admin-table td[data-label="Email"] {
        word-break: break-word;
    }

    /* Status badge */
    .admin-table td[data-label="Status"] {
        justify-content: space-between;
    }

    .badge {
        margin-left: auto;
    }

    /* Área de ações */
    .admin-table td[data-label="Ações"] {
        border-bottom: none;
        padding-top: 15px;
    }

    .product-actions {
        width: 100%;
    }

    .action-buttons {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        width: 100%;
    }

    .action-btn {
        width: 40px;
        height: 40px;
    }
}

/* Responsividade para tabela de usuários */
@media screen and (max-width: 900px) {
    .table-responsive {
        padding: 5px;
        margin: 0;
        width: 100vw;
        min-width: 0;
        overflow-x: auto;
    }
    .admin-table {
        width: 100%;
        min-width: 320px;
        font-size: 0.98rem;
    }
    .admin-table thead {
        display: none;
    }
    .admin-table tbody tr {
        display: flex;
        flex-direction: column;
        background: rgba(47, 49, 54, 0.9);
        margin-bottom: 15px;
        border-radius: 8px;
        padding: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        width: 100%;
    }
    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #00ff88;
        flex: 1;
        margin-right: 15px;
        min-width: 110px;
        font-size: 0.98rem;
    }
    .admin-table td:last-child {
        border-bottom: none;
    }
    .product-actions, .action-buttons {
        width: 100%;
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        flex-direction: column;
        align-items: stretch;
        margin-top: 8px;
    }
    .action-btn {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
}

/* Melhor responsividade para tabela de usuários em telas pequenas */
@media screen and (max-width: 600px) {
    .table-responsive {
        padding: 2px;
        margin: 0;
        width: 100vw;
        min-width: 0;
        overflow-x: auto;
    }
    .admin-table {
        width: 100%;
        min-width: 0;
        font-size: 0.97rem;
    }
    .admin-table tbody tr {
        display: flex;
        flex-direction: column;
        background: rgba(47, 49, 54, 0.95);
        margin-bottom: 12px;
        border-radius: 8px;
        padding: 8px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        width: 100%;
    }
    .admin-table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 7px 0;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        font-size: 0.97rem;
        width: 100%;
        box-sizing: border-box;
        word-break: break-word;
        /* Quebra o texto para baixo se necessário */
        white-space: normal;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #00ff88;
        margin-bottom: 2px;
        min-width: 90px;
        font-size: 0.97rem;
    }
    .admin-table td:last-child {
        border-bottom: none;
    }
    .product-actions, .action-buttons {
        width: 100%;
        display: flex;
        gap: 6px;
        flex-direction: column;
        align-items: stretch;
        margin-top: 6px;
    }
    .action-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        margin-bottom: 2px;
    }
    .badge {
        margin-top: 4px;
        margin-left: 0;
    }
}

/* Ajuste para telas muito pequenas */
@media screen and (max-width: 480px) {
    .settings-grid {
        padding: 2px;
    }
    .settings-card {
        padding: 6px;
    }
    .admin-table tbody tr {
        padding: 6px;
    }
    .admin-table td {
        flex-direction: column;
        align-items: flex-start;
        font-size: 0.95rem;
    }
    .admin-table td::before {
        margin-bottom: 4px;
    }
    .admin-table td[data-label="Status"] {
        flex-direction: row;
    }
    .action-buttons, .product-actions {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        margin-bottom: 2px;
    }
    .page-header h1 {
        font-size: 1.1rem;
        margin: 8px 0;
    }
}

/* Correção do tamanho do ícone de edição */
.action-btn.edit-btn i.fa-edit {
    font-size: 1.1rem !important;
    color: #00ff88;
    vertical-align: middle;
}

/* Melhorias visuais */
.badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.badge-danger {
    background: rgba(255, 51, 51, 0.2);
    color: #ff3333;
}

/* Animações e efeitos */
.admin-table tbody tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Alertas responsivos */
.alert {
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
}

/* Responsividade aprimorada para settings-grid e settings-card */
@media screen and (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 8px;
        margin-top: 60px;
        min-width: 0;
    }
    .settings-card {
        padding: 10px 6px;
        margin-bottom: 14px;
        border-radius: 10px;
        min-width: 0;
        box-sizing: border-box;
    }
}

@media screen and (max-width: 600px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 2px;
        margin-top: 40px;
        min-width: 0;
    }
    .settings-card {
        padding: 6px 2px;
        margin-bottom: 8px;
        border-radius: 8px;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* Prefixo exclusivo para página de usuários: .users- */
.users-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 20px;
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

.users-settings-card {
    background: rgba(47, 49, 54, 0.7);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.users-page-header {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.users-page-header h1 {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.users-table-responsive {
    margin-top: 20px;
    overflow-x: auto;
    background: rgba(26, 27, 30, 0.5);
    border-radius: 8px;
    padding: 15px;
}

.users-admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #fff;
    background: transparent;
}

/* Responsividade exclusiva para tabela de usuários */
@media screen and (max-width: 900px) {
    .users-settings-grid {
        gap: 12px;
        padding: 8px;
        margin-top: 60px;
    }
    .users-settings-card {
        padding: 10px 6px;
        margin-bottom: 14px;
        border-radius: 10px;
    }
    .users-table-responsive {
        padding: 5px;
        margin: 0;
        width: 100vw;
        min-width: 0;
        overflow-x: auto;
    }
    .users-admin-table {
        width: 100%;
        min-width: 320px;
        font-size: 0.98rem;
    }
    .users-admin-table thead {
        display: none;
    }
    .users-admin-table tbody tr {
        display: flex;
        flex-direction: column;
        background: rgba(47, 49, 54, 0.95);
        margin-bottom: 12px;
        border-radius: 8px;
        padding: 8px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
        width: 100%;
    }
    .users-admin-table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 7px 0;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        font-size: 0.97rem;
        width: 100%;
        box-sizing: border-box;
        word-break: break-word;
        white-space: normal;
    }
    .users-admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #00ff88;
        margin-bottom: 2px;
        min-width: 90px;
        font-size: 0.97rem;
    }
    .users-admin-table td:last-child {
        border-bottom: none;
    }
    .users-product-actions, .users-action-buttons {
        width: 100%;
        display: flex;
        gap: 6px;
        flex-direction: column;
        align-items: stretch;
        margin-top: 6px;
    }
    .users-action-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        margin-bottom: 2px;
    }
    .users-badge {
        margin-top: 4px;
        margin-left: 0;
    }
}

@media screen and (max-width: 600px) {
    .users-settings-grid {
        gap: 6px;
        padding: 2px;
        margin-top: 40px;
    }
    .users-settings-card {
        padding: 6px 2px;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    .users-admin-table td {
        font-size: 0.95rem;
    }
    .users-page-header h1 {
        font-size: 1.2rem;
    }
}

/* Badge exclusiva */
.users-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}
.users-badge-success {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}
.users-badge-danger {
    background: rgba(255, 51, 51, 0.2);
    color: #ff3333;
}

/* Botões exclusivos */
.users-action-btn.edit-btn i.fa-edit {
    font-size: 1.1rem !important;
    color: #00ff88;
    vertical-align: middle;
}

/* Header e card visual */
.settings-card {
    background: linear-gradient(120deg, #23272a 70%, #18191c 100%);
    border-radius: 16px;
    padding: 32px 20px 24px 20px;
    margin-bottom: 32px;
    box-shadow: 0 4px 24px rgba(0,255,136,0.06);
    border: 1.5px solid rgba(0,255,136,0.08);
}

.page-header {
    margin-bottom: 32px;
    border-bottom: 2px solid #00ff88;
    padding-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 {
    color: #00ff88;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0,255,136,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

@media screen and (max-width: 900px) {
    .settings-card {
        padding: 18px 6px 14px 6px;
        margin-bottom: 18px;
        border-radius: 12px;
    }
    .page-header {
        margin-bottom: 18px;
        padding-bottom: 10px;
    }
    .page-header h1 {
        font-size: 1.3rem;
    }
    .admin-table {
        min-width: 600px;
        font-size: 0.97rem;
    }
}

@media screen and (max-width: 600px) {
    .settings-card {
        padding: 8px 2px 8px 2px;
        margin-bottom: 10px;
        border-radius: 8px;
    }
    .page-header {
        margin-bottom: 10px;
        padding-bottom: 6px;
    }
    .page-header h1 {
        font-size: 1.05rem;
    }
    .admin-table {
        min-width: 480px;
        font-size: 0.95rem;
    }
    .table-responsive {
        padding: 2px;
    }
}