/* ============================================================
   INICIO BLOQUE 1 - RESETEO GENERAL Y ESTILOS BASE
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    background-color: #f8f9fa;
    color: #212529;
}

h1, h2, h3, h4, h5 {
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilidades */
.text-sm {
    font-size: 0.875rem;
}

.bg-light-blue {
    background-color: #e7f3ff;
}

.border-rounded {
    border-radius: 0.5rem;
}

/* ============================================================
   FIN BLOQUE 1 - RESETEO GENERAL Y ESTILOS BASE
   ============================================================ */

/* ============================================================
   INICIO BLOQUE 2 - SIDEBAR Y TOPBAR
   ============================================================ */

#sidebar {
    background-color: #343a40;
    min-height: 100vh;
    padding: 1rem;
    color: white;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
}

#sidebar .nav-link {
    color: #adb5bd;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.3rem;
}

#sidebar .nav-link.active,
#sidebar .nav-link:hover {
    background-color: #495057;
    color: #fff;
}

#topbar {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-left: 250px;
}

#topbar h5 {
    margin: 0;
    color: #343a40;
}

/* Para adaptar el contenido principal */
#main-content {
    margin-left: 250px;
    padding: 2rem 1.5rem;
}

/* ============================================================
   FIN BLOQUE 2 - SIDEBAR Y TOPBAR
   ============================================================ */

/* ============================================================
   INICIO BLOQUE 3 - TARJETAS DEL DASHBOARD
   ============================================================ */

.card-dashboard {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.25rem;
    transition: all 0.2s ease-in-out;
    margin-bottom: 1rem;
    text-align: center;
}

.card-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-dashboard h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #0d6efd;
    margin-bottom: 0.25rem;
}

.card-dashboard p {
    font-size: 0.95rem;
    color: #6c757d;
}

/* ============================================================
   FIN BLOQUE 3 - TARJETAS DEL DASHBOARD
   ============================================================ */

/* ============================================================
   INICIO BLOQUE 4 - FORMULARIOS Y MODALES
   ============================================================ */

.modal-header {
    background-color: #0d6efd;
    color: white;
    border-bottom: none;
}

.modal-title {
    font-weight: bold;
}

.modal-content {
    border-radius: 0.5rem;
    border: none;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

label {
    font-weight: 500;
}

/* Tablas dentro de modales */
.modal table {
    font-size: 0.9rem;
}

.modal table th {
    font-weight: 600;
}

/* ============================================================
   FIN BLOQUE 4 - FORMULARIOS Y MODALES
   ============================================================ */

/* ============================================================
   INICIO BLOQUE 5 - AGENDA Y EVENTOS DEL CALENDARIO
   ============================================================ */

#listaEventos {
    max-height: 400px;
    overflow-y: auto;
}

.evento-agenda {
    border-left: 5px solid #0d6efd;
    background-color: #f1f8ff;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.35rem;
}

.evento-agenda strong {
    color: #0d6efd;
}

.evento-agenda small {
    display: block;
    color: #6c757d;
}

/* Estilo para campos de fecha */
input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 0.3rem;
}

/* Botón flotante opcional para agregar evento */
.boton-flotante {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: #0d6efd;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 1050;
}

/* ============================================================
   FIN BLOQUE 5 - AGENDA Y EVENTOS DEL CALENDARIO
   ============================================================ */

/* ============================================================
   INICIO BLOQUE 6 - TABLAS Y LISTADOS
   ============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

thead {
    background-color: #0d6efd;
    color: white;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

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

/* Botones dentro de las tablas */
.table-actions button {
    margin-right: 0.25rem;
}

/* Badge de estado */
.badge-estado {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 0.4rem;
}

.badge-pendiente {
    background-color: #ffc107;
    color: #212529;
}

.badge-finalizado {
    background-color: #198754;
    color: white;
}

/* ============================================================
   FIN BLOQUE 6 - TABLAS Y LISTADOS
   ============================================================ */

/* ============================================================
   INICIO BLOQUE 7 - GRÁFICOS Y CHART.JS
   ============================================================ */

#dashboardGraficos {
    margin-top: 2rem;
}

#graficoGeneral {
    width: 100%;
    max-width: 800px;
    margin: auto;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Leyenda y etiquetas del gráfico */
.chart-legend {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 1rem;
    color: #6c757d;
}

/* Botones para cambiar tipo de gráfico (opcional) */
.chart-toggle-btns {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.chart-toggle-btns button {
    margin: 0 0.25rem;
}

/* ============================================================
   FIN BLOQUE 7 - GRÁFICOS Y CHART.JS
   ============================================================ */

/* ============================================================
   INICIO BLOQUE 8 - HELPERS, ALERTAS Y ELEMENTOS FLOTANTES
   ============================================================ */

/* Alertas flotantes */
.alert {
    z-index: 1055;
    min-width: 250px;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

/* Estilos para botones flotantes secundarios */
.btn-float {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    border-radius: 50%;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    background-color: #0d6efd;
    color: white;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1045;
}

/* Loader o spinner (si se usa) */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: girar 1s linear infinite;
    margin: auto;
}

@keyframes girar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Z-index utilitarios */
.z-3 {
    z-index: 1030;
}
.z-4 {
    z-index: 1040;
}
.z-5 {
    z-index: 1050;
}

/* ============================================================
   FIN BLOQUE 8 - HELPERS, ALERTAS Y ELEMENTOS FLOTANTES
   ============================================================ */
