/* =========================================
   RESET Y GLOBALES
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f1f5f9;
    color: #0f172a;
    height: 100vh;
    overflow: hidden; /* El scroll lo manejan los contenedores internos */
}

/* =========================================
   PANTALLA DE LOGIN
   ========================================= */
/* Nota: Los estilos del contenedor del login están inline en el JS para asegurar el centrado,
   aquí definimos los inputs y botones para que se vean bonitos */

input[type="text"],
input[type="password"],
input[type="search"] {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    outline: none;
}

input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    font-family: 'Inter', sans-serif;
    transition: transform 0.1s, opacity 0.2s;
}

button:active {
    transform: scale(0.98);
}

/* =========================================
   LAYOUT DASHBOARD (SIDEBAR & MAIN)
   ========================================= */
/* Scrollbar personalizado para el sidebar y tablas */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animaciones suaves */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#admin-content {
    animation: fadeIn 0.3s ease-out;
}

/* =========================================
   TARJETAS DASHBOARD (CARDS)
   ========================================= */
/* Los estilos base están en el JS, aquí añadimos efectos hover */
.dashboard-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* =========================================
   TABLAS DE DATOS (IMPORTANTE)
   ========================================= */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 0 0 12px 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Evita que se rompa en pantallas muy pequeñas */
}

thead tr {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #f8fafc;
}

td {
    color: #334155;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Badges de estatus (Pildoras) */
.status-badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

/* =========================================
   MODALES Y UTILIDADES
   ========================================= */
/* El modal se genera dinámicamente en JS, pero usamos esto para inputs dentro de modales si fuera necesario */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* Botón de actualizar tabla */
.btn-refresh:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Responsive básico para sidebar */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    aside {
        width: 100% !important;
        height: auto !important;
        flex-direction: row !important;
        overflow-x: auto;
        padding-bottom: 0 !important;
    }
    aside nav {
        display: flex;
        padding: 10px !important;
    }
    aside .logo-section, aside button {
        display: none; /* Ocultar logout y logo en móvil para simplificar */
    }
    main {
        height: calc(100vh - 60px);
    }
}
