:root {
    --primary-color: #7d32a8;
    --accent-color: #00d4c5;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.admin-container {
    max-width: 1100px;
    margin: 0 auto;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 30px;
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    color: var(--primary-color);
    margin: 0;
}

/* Filtros */
.filter-card {
    padding: 20px;
    margin-bottom: 25px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group.main-search {
    flex: 2;
    min-width: 200px;
}

.filter-group.actions {
    flex: none;
    display: flex;
    gap: 10px;
}

.filter-form input, .filter-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
}

.filter-form input:focus, .filter-form select:focus {
    border-color: var(--primary-color);
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.table-wrapper {
    overflow-x: auto;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 16px;
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: #f0f2f5;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #fafbfc;
    color: #8898aa;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

td {
    padding: 18px 20px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.status-active { background-color: #d1fae5; color: #065f46; }
.status-unsubscribed { background-color: #fee2e2; color: #991b1b; }

.btn {
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-danger { background-color: var(--danger-color); color: #fff; }
.btn-warning { background-color: var(--warning-color); color: #fff; }
.btn-success { background-color: var(--success-color); color: #fff; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #fff;
    margin: 8vh auto;
    padding: 35px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    body { padding: 10px; }
    
    .header-actions {
        flex-direction: column;
        text-align: center;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .btn { 
        width: 100%; 
        max-width: 100%;
        margin-bottom: 5px;
    }

    .card {
        padding: 15px;
    }

    .table-wrapper {
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    table thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }

    tr {
        background: #fff;
        margin-bottom: 20px;
        border-radius: 20px;
        padding: 20px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.06);
        border: 1px solid #edf2f7;
    }

    td {
        text-align: center;
        padding: 12px 0;
        border-bottom: 1px solid #f7fafc;
        display: flex;
        flex-direction: column;
        align-items: center;
        word-break: break-all;
    }

    td:last-child {
        border-bottom: none;
        gap: 10px;
        padding-top: 15px;
        align-items: stretch;
    }

    td::before {
        content: attr(data-label);
        font-weight: 800;
        text-transform: uppercase;
        font-size: 0.65rem;
        color: #a0aec0;
        margin-bottom: 5px;
    }

    td[data-label="Email"] {
        font-weight: 600;
        color: var(--primary-color);
        font-size: 1rem;
    }
}
