/* css/style.css */

/* --- 1. Importación de Fuente y Variables Globales --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --sidebar-bg: #212529;
    --sidebar-link-hover: #343a40;
    --sidebar-link-active: #0d6efd;
    --body-bg: #f4f7fc;
    --card-bg: #ffffff;
    --text-color: #495057;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 0.8rem 1.5rem rgba(0, 0, 0, 0.08);
    --border-radius: 0.5rem;
}

/* --- 2. Estilos Generales y Tipografía --- */
body {
    background-color: var(--body-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* --- 3. Barra Lateral de Navegación --- */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 250px; z-index: 1030; /* z-index alto para que esté por encima del contenido */
    background-color: var(--sidebar-bg);
    box-shadow: inset -2px 0 5px rgba(0, 0, 0, .1);
    padding-top: 1rem;
}
.sidebar .sidebar-header {
    color: #fff; font-size: 1.25rem; font-weight: 600;
    padding: .5rem 1.5rem 1.5rem;
}
.sidebar .nav-link {
    color: rgba(255, 255, 255, .7); display: flex; align-items: center;
    padding: .8rem 1.5rem; transition: all 0.2s ease-in-out;
    border-left: 3px solid transparent;
}
.sidebar .nav-link .feather { margin-right: 12px; width: 20px; height: 20px; }
.sidebar .nav-link:hover { color: #fff; background-color: var(--sidebar-link-hover); }
.sidebar .nav-link.active {
    color: #fff; font-weight: 500;
    background-color: var(--sidebar-link-active);
    border-left: 3px solid #6fa8ff;
}

/* --- 4. Contenido Principal --- */
.main-content {
    margin-left: 250px;
    padding: 2rem;
}

/* --- 5. Componentes (Tarjetas, Botones, Tablas) --- */
.card {
    border: none; box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
    transition: all 0.3s ease-in-out;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.card-header { background-color: var(--card-bg); border-bottom: 1px solid #e3e6f0; font-weight: 600; }
.btn { border-radius: var(--border-radius); font-weight: 500; transition: all 0.2s ease-in-out; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.table-hover tbody tr:hover { background-color: #eef2f7; }
.table thead th { font-weight: 600; border-bottom-width: 2px; color: #343a40; }

/* --- 6. Página de Login --- */
.login-container { min-height: 100vh; background: url('https://ajoguapy.com/onyx/img/login-bg.jpg') no-repeat center center; background-size: cover; }
.login-card { background-color: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px); border: none; border-radius: 0.75rem; box-shadow: 0 1rem 3rem rgba(0,0,0,0.175) !important; }

/*
 * --- 7. ESTILOS PARA NOTIFICACIONES ---
 */

/* Notificación Flash (barra superior de PHP) */
.flash-message-bar {
    position: fixed; /* Posición fija en la pantalla */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1031; /* Un z-index alto para que esté por encima de la barra lateral */
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    border-left: 5px solid;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-weight: 500;
}
.flash-message-bar.alert-success { border-left-color: var(--success-color); }
.flash-message-bar.alert-danger { border-left-color: var(--danger-color); }

/* Notificaciones Toast (esquina de JavaScript) */
.toast-container {
    z-index: 1090; /* El z-index más alto para que aparezca sobre todo */
}
.toast {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.15);
}
.toast .toast-body { font-weight: 500; }

/* --- 8. Dashboard y otros --- */
.card.border-start-primary { border-left: .25rem solid var(--primary-color) !important; }
.card.border-start-success { border-left: .25rem solid var(--success-color) !important; }
.card.border-start-info { border-left: .25rem solid #0dcaf0 !important; }
.card.border-start-warning { border-left: .25rem solid var(--warning-color) !important; }
.text-xs { font-size: .8rem; }
.text-gray-300 { color: #cacaca !important; }
.img-thumbnail.object-fit-cover { object-fit: cover; }