:root {
    --primary-color: #D900FF;
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --border-color: #D900FF;
    --glow-shadow: 0 0 10px rgba(217, 0, 255, 0.2), 0 0 20px rgba(217, 0, 255, 0.1);
    --input-bg: #f9f9f9;
}

[data-theme="dark"] {
    --bg-color: #0b0b0c;
    --text-color: #f5f5f5;
    --card-bg: #141416;
    --glow-shadow: 0 0 15px rgba(217, 0, 255, 0.4), 0 0 30px rgba(217, 0, 255, 0.2);
    --input-bg: #1f1f23;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* DISEÑO DE LA PANTALLA DE AUTENTICACIÓN (BUFFER) */
#auth-screen {
    max-width: 400px;
    margin: 120px auto;
    text-align: center;
}

#auth-screen h2 {
    margin-bottom: 20px;
}

#auth-form {
    text-align: left;
}

/* Encabezado */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 25px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.header-controls button {
    margin-left: 10px;
}

/* Cajas Estilo Glow */
.glow-box {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--glow-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.section-header h2 {
    margin-bottom: 0;
}

/* Formularios */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
}

input, select {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid rgba(217, 0, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    font-size: 1rem;
    outline: none;
    width: 100%;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(217, 0, 255, 0.5);
}

/* Botones */
button {
    cursor: pointer;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.95rem;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 0 12px rgba(217, 0, 255, 0.6);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(217, 0, 255, 0.1);
}

.btn-danger {
    background-color: #ff3b30;
    color: white;
}

.btn-action {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-right: 4px;
}

/* Filtros */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* Tablas */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    text-align: left;
    min-width: 500px;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid rgba(217, 0, 255, 0.1);
}

th {
    font-weight: 600;
    opacity: 0.7;
}

/* Carrito y totales */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-total-container {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 20px;
    color: var(--primary-color);
}

.hidden {
    display: none !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #auth-screen {
        margin: 50px 10px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-controls button {
        margin: 5px;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .filters {
        flex-direction: column;
    }

    .cart-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .btn-action {
        display: inline-block;
        margin-bottom: 5px;
    }
}