/* D:\xamp\htdocs\agenda-aulas\public\css\custom.css */
/* Aquí puedes añadir todas tus reglas de CSS personalizadas */

/* Paleta de marca (prioritaria); alinea Bootswatch/Zephyr con los colores institucionales */
:root,
html[data-bs-theme="light"] {
    --brand-blue-dark: #0671b7;
    --brand-blue-light: #3da3e6;
    --brand-orange: #fe981c;
    --brand-gray-dark: #626262;

    --bs-primary: #0671b7;
    --bs-primary-rgb: 6, 113, 183;
    --bs-secondary: #626262;
    --bs-secondary-rgb: 98, 98, 98;
    --bs-info: #3da3e6;
    --bs-info-rgb: 61, 163, 230;
    --bs-warning: #fe981c;
    --bs-warning-rgb: 254, 152, 28;

    --bs-link-color: #0671b7;
    --bs-link-hover-color: #055a92;
    --bs-focus-ring-color: rgba(6, 113, 183, 0.28);

    --bs-primary-bg-subtle: #e8f4fc;
    --bs-primary-border-subtle: #9ccfeb;
    --bs-info-bg-subtle: #eaf6fd;
    --bs-info-border-subtle: #a6d6f3;
    --bs-warning-bg-subtle: #fff4e8;
    --bs-warning-border-subtle: #ffd49a;

    --bs-heading-color: #626262;
    --bs-secondary-color: rgba(98, 98, 98, 0.88);
    --bs-tertiary-color: rgba(98, 98, 98, 0.62);

    --app-radius: 0.5rem;
    --app-radius-sm: 0.375rem;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
}
.container{
    margin-top: 50px
}

/* Login: fade-up suave al cargar */
@keyframes login-fade-up {
    from {
        opacity: 0;
        transform: translate3d(0, 1.25rem, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.login-page-card {
    opacity: 0;
    animation: login-fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .login-page-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Estilos que estaban en _header.php */
.slot { 
    cursor:pointer; 
    min-height:42px; 
    font-size:12px; 
}
.slot.filled { 
    color:#fff; 
}
.slot .small { 
    font-size:11px; 
}
.table-sticky thead th { 
    position: sticky; 
    top: 0; 
    background: var(--bs-body-bg); 
    z-index: 2; 
}
.table-sticky thead th:first-child { 
    left: 0; 
    z-index:3; 
}
.table-sticky tbody th { 
    position: sticky; 
    left: 0; 
    background: var(--bs-body-bg); 
    z-index: 1; 
}

/* Estilos que estaban en dashboard.php */
.slot-event {
    padding: 2px 4px;
    border-radius: 4px;
    color: #fff;
    margin-bottom: 2px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.slot-event:hover {
    opacity: 0.8;
}

/* Estilos para la cabecera del calendario */
.fc-col-header-cell,
.fc-timegrid-axis {
    background-color: #e9ecef !important;
    color: #495057 !important;
}
.fc-col-header-cell-cushion{
    color: var(--bs-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 300
}
.fc-col-header-cell-cushion:hover{
    text-decoration: underline;
}
.fc-scrollgrid-shrink-cushion{
    color: var(--bs-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 300
}
.fc-scrollgrid-shrink-cushion::after{
    content: ' hs';
}

/* Estilo para los bordes del calendario */
.fc-theme-standard td, 
.fc-theme-standard th,
.fc-scrollgrid {
    border-color: #dee2e6 !important;
}

/* Tamaño de fuente más pequeño para elementos de formulario y botones */
.form-control,
.form-select,
.btn {
    font-size: 0.9rem !important;
}
.fc-button-primary{
    font-size: 14px !important;
    font-weight: 300 !important;
}
.fc-toolbar-title{
    font-size: 1.3em!important;
    text-transform: uppercase;
    color: var(--bs-primary);
}
h4{
    font-size: 2em!important; 
    font-weight: 100;
    color: var(--brand-gray-dark);
}
.navbar-brand{
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8em!important;
    background-color: transparent;
    padding: 8px 12px;
    border-radius: 0;
    border: none;
    box-shadow: none;
}
.nav-item{
    margin: 0 3px;
}
.nav-link{
    font-size: 0.8em!important;
    font-weight: 300;
    color: var(--brand-gray-dark);
    text-transform: uppercase;
}
.nav-link:hover,
.nav-link.active {
    color: var(--bs-primary);
    text-decoration: none;
    background-color: rgba(var(--bs-info-rgb), 0.14);
    border-radius: 5px;
}
.navbar-text{
    font-size: 0.8em!important;
    font-weight: 300;
    color: var(--brand-gray-dark);
}
.th-small{
    font-size: 0.8em!important;
}
.td-small{
    font-size: 0.8em!important;
}

.insurance-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    background-color: var(--brand-gray-dark);
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

/* Botones extra pequeños para acciones en tablas */
.btn-xs {
    --bs-btn-padding-y: .1rem;
    --bs-btn-padding-x: .4rem;
    --bs-btn-font-size: .75rem;
}

html[data-bs-theme="light"] .bg-dark,
html[data-bs-theme="light"] .card.bg-dark,
html[data-bs-theme="light"] .modal-content.bg-dark,
html[data-bs-theme="light"] .modal-header.bg-dark,
html[data-bs-theme="light"] .modal-body.bg-dark,
html[data-bs-theme="light"] .modal-footer.bg-dark,
html[data-bs-theme="light"] tr.table-dark,
html[data-bs-theme="light"] .badge.bg-dark {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-emphasis-color) !important;
    border-color: var(--bs-border-color) !important;
}

html[data-bs-theme="light"] .bg-dark .text-white,
html[data-bs-theme="light"] .bg-dark.text-white,
html[data-bs-theme="light"] .bg-dark label,
html[data-bs-theme="light"] .bg-dark .form-check-label,
html[data-bs-theme="light"] .table-dark th,
html[data-bs-theme="light"] .table-dark td,
html[data-bs-theme="light"] .table-dark a {
    color: var(--bs-emphasis-color) !important;
}

html[data-bs-theme="light"] .table-dark {
    --bs-table-color: var(--bs-emphasis-color);
    --bs-table-bg: #e9ecef;
    --bs-table-border-color: #dee2e6;
    --bs-table-striped-bg: #f8f9fa;
    --bs-table-striped-color: var(--bs-emphasis-color);
    --bs-table-active-bg: #dde1e5;
    --bs-table-active-color: var(--bs-emphasis-color);
    --bs-table-hover-bg: #f1f3f5;
    --bs-table-hover-color: var(--bs-emphasis-color);
}

html[data-bs-theme="light"] .border-dark {
    border-color: var(--bs-border-color) !important;
}

html[data-bs-theme="light"] .btn-outline-light {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary);
}

html[data-bs-theme="light"] .btn-close-white {
    filter: none !important;
}

/* -----------------------------------------------------------------------------
   Capa sobre Bootstrap / Bootswatch (Zephyr): formularios y botones más limpios
   ----------------------------------------------------------------------------- */

.fc .fc-button-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.fc .fc-button-primary:not(:disabled):hover {
    background-color: #055a92 !important;
    border-color: #055a92 !important;
}

.btn:not(.btn-link):not(.btn-close) {
    border-radius: var(--app-radius-sm);
    font-weight: 500;
    letter-spacing: 0.015em;
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.12s ease;
}

.btn-primary,
.btn-success,
.btn-info,
.btn-danger,
.btn-warning {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-primary:active:not(:disabled),
.btn-success:active:not(:disabled),
.btn-info:active:not(:disabled),
.btn-danger:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.22);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--bs-success-rgb), 0.22);
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--bs-info-rgb), 0.2);
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--bs-warning-rgb), 0.28);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger {
    --bs-btn-bg: transparent;
}

.btn-lg {
    border-radius: var(--app-radius);
}

.btn-sm,
.btn-xs {
    border-radius: var(--app-radius-sm);
}

.form-control,
.form-select {
    border-radius: var(--app-radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.12);
}

.form-label,
.col-form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.35rem;
}

.input-group > .form-control,
.input-group > .form-select {
    border-radius: var(--app-radius-sm);
}

.card {
    border-radius: var(--app-radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.06);
}

.card.border-0 {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.12);
}

/* Contenedor fijo para Chart.js (maintainAspectRatio: false) */
.chart-host {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 220px;
}
.chart-host.chart-host--tall {
    height: 380px;
    min-height: 280px;
}

/* -------------------------------------------------------------------------
   Móvil (<= 768px): legibilidad, scroll en tablas, gráficos y layout
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        overflow-x: hidden;
    }

    .container {
        margin-top: 0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-width: 100%;
    }

    h1, .h1 { font-size: 1.45rem; }
    h2, .h2 { font-size: 1.3rem; }
    h3, .h3 { font-size: 1.15rem; }
    h4, .h4 {
        font-size: 1.1rem !important;
        font-weight: 600;
        line-height: 1.3;
        word-break: break-word;
    }
    h5, .h5 { font-size: 1rem; }
    h6, .h6, .card-header h6 {
        font-size: 0.95rem;
        line-height: 1.35;
        word-break: break-word;
    }

    .navbar .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .navbar-brand img {
        max-height: 36px !important;
    }

    .navbar-collapse .nav-link {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Tablas: desplazamiento horizontal cómodo en táctil */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        max-width: 100%;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
    }

    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: rgba(98, 98, 98, 0.35);
        border-radius: 3px;
    }

    .table {
        font-size: 0.8125rem;
        margin-bottom: 0;
    }

    .table thead th {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .table-sticky thead th,
    .table-sticky tbody th {
        z-index: 2;
    }

    /* Filtros en cabeceras de card con anchos fijos inline */
    .card-header .d-flex form.d-flex,
    .card-header form.d-flex {
        flex-wrap: wrap !important;
        width: 100%;
        max-width: 100%;
    }

    .card-header form.d-flex .input-group,
    .card-header form.d-flex .form-select,
    .card-header form.d-flex > .form-control {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .card-header form.d-flex .btn {
        flex: 0 0 auto;
    }

    .d-flex.flex-nowrap {
        flex-wrap: wrap !important;
    }

    .row.g-3 > [class*="col-"],
    .row.g-4 > [class*="col-"] {
        min-width: 0;
    }

    /* FullCalendar: barra de herramientas apilada */
    .fc .fc-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .fc-toolbar-title {
        font-size: 1rem !important;
        text-align: center;
    }

    /* Alturas de gráficos en celular */
    .chart-host {
        height: 240px;
        min-height: 200px;
    }

    .chart-host.chart-host--tall {
        height: 300px;
        min-height: 240px;
    }

    .card-body:has(> canvas):not(.chart-host) {
        position: relative;
        min-height: 200px;
        height: 240px;
    }

    /* Modal: tablas dentro del cuerpo */
    .modal-body .table-responsive {
        max-height: min(70vh, 28rem);
        overflow-y: auto;
    }

    .dashboard-matriculas .table-responsive {
        font-size: 0.7rem;
    }

    /* Grilla semanal (muchas columnas): forzar scroll horizontal útil */
    .table-responsive > .table.table-sticky {
        min-width: 36rem;
    }
}