/* admin.css - Estilos exclusivos para la gestión de usuarios, tablas y pedidos (Orders) */

/* --- PANEL ADMIN / GESTIÓN DE USUARIOS --- */
.admin-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f2f6;
}

.admin-header h2 {
    color: var(--secondary);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-actions-top {
    display: flex;
    gap: 15px;
}

/* DATA TABLES (Premium Design) */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f2f6;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    background: white;
}

.data-table th {
    background: #f8fbfb;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #edf2f7;
}

.data-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f2f6;
    color: var(--text);
    font-size: 0.95rem;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: all 0.2s;
}

.data-table tbody tr:hover {
    background: #fdfdfe;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

/* BADGES DE ROL */
.role-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.role-admin {
    background: rgba(108, 92, 231, 0.1);
    color: #6c5ce7;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.role-user {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary);
    border: 1px solid rgba(26, 115, 232, 0.2);
}

.date-text {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* SWITCH TOGGLE ESTILO IOS */
.switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-gray);
}

.switch input {
    display: none;
}

.slider {
    position: relative;
    width: 46px;
    height: 24px;
    background-color: #e4e8ec;
    border-radius: 50px;
    transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* CARDS DE PEDIDOS EN HISTORIAL (Orders View) */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.order-item-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.order-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: rgba(26, 115, 232, 0.3);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #e1e5ee;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.order-number {
    font-weight: 700;
    color: var(--secondary);
    font-size: 1.1rem;
}

.order-date {
    font-size: 0.85rem;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.order-user-info {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fbfb;
    padding: 10px;
    border-radius: 8px;
}

.order-user-info i {
    color: var(--primary);
    font-size: 1.2rem;
}

.order-user-details p {
    margin: 0;
    line-height: 1.4;
}

.order-user-name {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.95rem;
}

.order-user-email {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.order-items-list {
    flex-grow: 1;
    margin-bottom: 15px;
}

.order-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 1px solid #f9f9f9;
}

.order-detail-item:last-child {
    border-bottom: none;
}

.order-item-name {
    color: var(--secondary);
    flex-grow: 1;
}

.order-item-qty {
    background: #eef2f6;
    color: var(--text);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 10px;
}

.order-item-price {
    font-weight: 600;
    color: var(--text);
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #f1f2f6;
    padding-top: 15px;
    margin-top: auto;
}

.order-total-label {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.order-total-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--secondary);
}