@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
}

body {
    background-color: #f5f5f7; /* Gris estilo Apple */
    color: #1d1d1f; /* Texto oscuro */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Loader 3D */
#loader-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #f5f5f7;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s;
}
.cube-spinner {
    width: 50px;
    height: 50px;
    background-color: #1d1d1f;
    animation: rotateCube 1.5s infinite ease-in-out;
    border-radius: 12px;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.1), 0 15px 25px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}
.loader-text {
    font-size: 14px;
    color: #8c6b4a; /* Tono amaderado */
    font-weight: 500;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}
@keyframes rotateCube {
    0% { transform: perspective(150px) rotateX(0deg) rotateY(0deg); }
    50% { transform: perspective(150px) rotateX(-180.1deg) rotateY(0deg); background-color: #8c6b4a; }
    100% { transform: perspective(150px) rotateX(-180deg) rotateY(-179.9deg); background-color: #1d1d1f; }
}
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* Contenedores Principales */
.glass-container {
    background: #ffffff;
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    animation: slideUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}
.admin-container { max-width: 1000px; }

@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

h1 {
    text-align: center;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 26px;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}
p.subtitle {
    text-align: center;
    font-size: 15px;
    margin-bottom: 30px;
    color: #86868b;
}

.form-group { margin-bottom: 20px; position: relative; }
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: #1d1d1f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231d1d1f%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
}
input:focus, select:focus {
    border-color: #8c6b4a; /* Tono madera */
    box-shadow: 0 0 0 4px rgba(140, 107, 74, 0.15);
}
input::placeholder { color: #86868b; }

button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #1d1d1f; /* Negro puro estilo Mac */
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}
button:hover {
    background: #8c6b4a; /* Efecto amaderado al pasar el ratón */
    transform: scale(0.98);
}
button:disabled {
    background: #d2d2d7;
    color: #86868b;
    cursor: not-allowed;
    transform: none;
}

.hidden { display: none !important; }

.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}
.alert.error { background: #ffebeb; color: #cc0000; display: block; }
.alert.success { background: #eefbed; color: #15803d; display: block; }

/* Admin Styles */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
.chart-box, .table-box {
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #e5e5ea;
}
.table-box { max-height: 400px; overflow: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid #f5f5f7; }
th { font-weight: 600; color: #86868b; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
td { color: #1d1d1f; font-weight: 500; }
.btn-delete { background: #ffebeb; color: #cc0000; padding: 6px 12px; font-size: 12px; border-radius: 6px; width: auto; margin: 0;}
.btn-delete:hover { background: #cc0000; color: #fff; transform: none; }

/* Desktop / Grandes pantallas */
@media (min-width: 768px) {
    body { padding: 40px; }
    .glass-container { padding: 50px; max-width: 600px; }
    .glass-container.admin-container { max-width: 1100px; }
    h1 { font-size: 36px; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 30px; }
    .chart-box, .table-box { padding: 30px; }
    table { font-size: 15px; }
}
