:root {
    --primary-dark: #16213e;
    --accent-vibrant: #45b1af;
    --accent-soft: #fec899;
    --primary-teal: #008fb3;
    --white-bg: #ffffff;
    --text-main: #16213e;
}

.bg-vt-primary {
    background-color: var(--primary-dark);
}
.bg-secondary {
    background-color: var(--accent-soft);
}
.bg-tertiary {
    background-color: var(--accent-vibrant);
}
.bg-teal {
    background-color: var(--primary-teal);
}
.bg-white {
    background-color: var(--white-bg);
}

.text-soft {
    color: var(--accent-soft);
}
.text-teal{
    color: var(--primary-teal);
}

.border-teal {
    border-color: var(--primary-teal);
}

/* Compatibilidad con utilidades de Tailwind que usan variantes (ej: "focus:border-teal")
   Algunos entornos no recompilan clases variantes personalizadas, por eso añadimos
   reglas explícitas para que `focus:border-teal` funcione correctamente. */
.focus\:border-teal:focus {
    border-color: var(--primary-teal) !important;
}

/* Forzar borde teal en inputs dentro de modales y quitar el ring si existe */
.container-modal input:focus,
.container-modal select:focus,
.container-modal textarea:focus {
    border-color: var(--primary-teal) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ── Focus-visible para accesibilidad (WCAG 2.4.7) ── */
:focus-visible {
    outline: 2px solid var(--primary-teal) !important;
    outline-offset: 2px !important;
}
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--primary-teal) !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}
.skip-link:focus {
    position: fixed !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 10000 !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Modo claro: contraste AA en campos dentro de modales.
   dark-mode.css fuerza border-color y placeholder con !important en ambos
   modos; estas reglas lo corrigen SOLO en modo claro y SOLO dentro de modales.
   Borde de campo slate-500 (#64748b) cumple 3:1 (WCAG no-texto) sobre blanco;
   :not(:focus) preserva el foco teal. Placeholder slate-500 cumple 4.5:1. */
html[data-theme="light"] .container-modal input:not([type="checkbox"]):not([type="radio"]):not(:focus),
html[data-theme="light"] .container-modal select:not(:focus),
html[data-theme="light"] .container-modal textarea:not(:focus) {
    border-color: rgb(171, 178, 189) !important;
}

html[data-theme="light"] .container-modal input::placeholder,
html[data-theme="light"] .container-modal textarea::placeholder {
    color: #64748b !important;
}

/* Header search input — mismo estilo que los inputs de modales */
#header-search:focus {
    border-color: var(--primary-teal) !important;
    box-shadow: none !important;
    outline: none !important;
    --tw-ring-color: transparent !important;
    --tw-ring-offset-color: transparent !important;
    --tw-ring-offset-width: 0px !important;
    --tw-ring-opacity: 0 !important;
}

/* Forzar la eliminación del "ring" de Tailwind dentro de modales y asegurar el borde teal.
   Se sobreescriben variables usadas por las utilidades de ring y las sombras generadas. */
.container-modal input:focus,
.container-modal select:focus,
.container-modal textarea:focus,
.container-modal button:focus,
.container-modal .focus\:ring-2:focus,
.container-modal .focus\:ring-tertiary:focus,
.container-modal .ring:focus {
    border-color: var(--primary-teal) !important;
    box-shadow: none !important;
    outline: none !important;
    --tw-ring-color: transparent !important;
    --tw-ring-offset-color: transparent !important;
    --tw-ring-offset-width: 0px !important;
    --tw-ring-opacity: 0 !important;
}

/* Hover/transition explícitos para botones dentro de modales (fallback cuando no hay clases Tailwind cargadas) */
.container-modal .confirmarBtn {
    transition: background-color .18s ease, transform .12s ease, box-shadow .12s ease;
}
.container-modal .confirmarBtn:hover,
.container-modal .confirmarBtn:focus {
    background-color: #06637f; /* color más oscuro del teal */
    transform: translateY(-1px);
}


/* ============================================
   Variantes de gradiente (from-* / to-*)
   Necesarias para que las utilidades de
   gradiente de Tailwind (bg-gradient-to-*)
   funcionen con los colores personalizados.
   ============================================ */
.from-vt-primary {
    --tw-gradient-from: var(--primary-dark);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.to-vt-primary {
    --tw-gradient-to: var(--primary-dark);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-secondary {
    --tw-gradient-from: var(--accent-soft);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.to-secondary {
    --tw-gradient-to: var(--accent-soft);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-tertiary {
    --tw-gradient-from: var(--accent-vibrant);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.to-tertiary {
    --tw-gradient-to: var(--accent-vibrant);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-teal {
    --tw-gradient-from: var(--primary-teal);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.to-teal {
    --tw-gradient-to: var(--primary-teal);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.text-main {
    color: var(--text-main);
}
.text-primary {
    color: var(--primary-dark);
}
.text-secondary {
    color: var(--accent-soft);
}
.text-tertiary {
    color: var(--accent-vibrant);
}
.text-teal {
    color: var(--primary-teal);
}

/* 🔧 Variantes hover para tertiary (accent-vibrant) */
.hover\:border-tertiary:hover {
    border-color: var(--accent-vibrant) !important;
}
.hover\:bg-tertiary\/5:hover {
    background-color: rgba(69, 177, 175, 0.05) !important;
}
.hover\:bg-tertiary\/10:hover {
    background-color: rgba(69, 177, 175, 0.1) !important;
}
.group:hover .group-hover\:text-tertiary {
    color: var(--accent-vibrant) !important;
}
.hover\:text-tertiary:hover {
    color: var(--accent-vibrant) !important;
}
/* 🔧 Variante hover para teal */
.hover\:text-teal:hover {
    color: var(--primary-teal) !important;
}
.hover\:bg-teal:hover {
    background-color: var(--primary-teal) !important;
}
/* 🔧 bg-tertiary con opacidad (./* ya existe bg-tertiary */
.bg-tertiary\/10 {
    background-color: rgba(69, 177, 175, 0.1) !important;
}
.bg-tertiary\/5 {
    background-color: rgba(69, 177, 175, 0.05) !important;
}
.text-white {
    color: var(--white-bg);
}

@layer utilities {
    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }
    .scrollbar-hide {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ============================================
   Estilos del Dashboard
   (Utilizados por src/views/home.php y compartidos
   con los demás componentes del sistema)
   ============================================ */
.dash-root {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* Scrollbar discreta */
.dash-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.dash-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
.dash-scroll::-webkit-scrollbar-track { background: transparent; }

/* Checkboxes personalizados (rounded + check blanco) */
.dash-check {
    appearance: none;
    -webkit-appearance: none;
    width: 1.15rem; height: 1.15rem;
    border: 2px solid #cbd5e1;
    border-radius: 0.45rem;
    background-color: #fff;
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: all .15s ease;
    flex-shrink: 0;
}
.dash-check:hover { border-color: #818cf8; }
.dash-check:checked { background-color: #4f46e5; border-color: #4f46e5; }
.dash-check:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 1px;
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Celdas del calendario */
.dash-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    border-radius: 9999px;
    cursor: pointer;
    transition: all .15s ease;
}
.dash-day:hover:not(.is-empty):not(.is-today) { background: #f1f5f9; }
.dash-day.is-today {
    background: #fb923c; /* orange-400 */
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(251, 146, 60, .35);
}
.dash-day.is-empty { cursor: default; }

/* Tareas completadas */
.dash-task-done { text-decoration: line-through; color: #94a3b8; }

/* Botones interactivos de la app
   Combina con: bg-tertiary text-white px-4 py-2 rounded-lg font-medium
   transition-colors flex items-center gap-2
   Aporta: cursor:pointer, transition con transform y hover:bg-teal + scale 1.05
   .btn-app { cursor:pointer; transition:all .2s ease; }
   .btn-app:hover { background-color:var(--primary-teal); transform:scale(1.05); } */
.btn-app {
    cursor: pointer;
    transition: all .2s ease;
}
.btn-app:hover {
    background-color: var(--primary-teal) !important; /* bg-teal */
    transform: scale(1.05);
}
.btn-app:active {
    transform: scale(0.98);
}

/* Variante secundaria (para botones outline / claros): hover indigo + scale */
.btn-app-secondary {
    cursor: pointer;
    transition: all .2s ease;
}
.btn-app-secondary:hover {
    background-color: #4f46e5 !important; /* indigo-600 */
    color: #fff !important;
    transform: scale(1.05);
    border-color: transparent !important;
}
.btn-app-secondary:active {
    transform: scale(0.98);
}

/* ============================================
   Sidebar responsive — CSS puro con animación
   ============================================ */

/* Sidebar: oculto con translate y visibility en móvil */
.sidebar-main {
    visibility: hidden;
    transform: translateX(-100%);
    transition: visibility 0.3s, transform 0.3s ease;
}

/* Botón hamburguesa: visible solo en móvil */
#btnHamburguesa {
    display: flex;
}

/* Overlay: oculto por defecto */
#sidebarOverlay {
    display: none;
}

/* Cuando el body tiene clase sidebar-open, mostrar sidebar y overlay en móvil */
body.sidebar-open .sidebar-main {
    visibility: visible;
    transform: translateX(0);
}
body.sidebar-open #sidebarOverlay {
    display: block;
}
body.sidebar-open #btnHamburguesa {
    display: flex;
}

/* En desktop (>=1024px): sidebar siempre visible, hamburguesa y overlay ocultos */
@media (min-width: 1024px) {
    .sidebar-main {
        visibility: visible !important;
        transform: translateX(0) !important;
    }
    #btnHamburguesa {
        display: none !important;
    }
    #sidebarOverlay {
        display: none !important;
    }
    #mainContent {
        margin-left: 256px;
    }
    #mainContentLogin{
        margin-left: 0px;
    }
}

/* ── Responsive: tablets y laptops pequeñas (768px - 1023px) ── */
@media (max-width: 1023px) and (min-width: 768px) {
    #mainContent {
        margin-left: 0;
        margin-top: 2px;
        margin-bottom: 2px;
        margin-right: 2px;
    }
    #main-content {
        padding: 1rem !important;
    }
    .sidebar-main {
        width: 220px !important;
    }
}

/* ── Responsive: móvil (<768px) ── */
@media (max-width: 767px) {
    #mainContent {
        margin: 4px !important;
        border-radius: 1rem !important;
    }
    #main-content {
        padding: 0.75rem !important;
    }
    .sidebar-main {
        width: min(256px, 80vw) !important;
    }
    /* Header más compacto */
    .header-actions {
        display: none;
    }
}

/* ── Tablas responsive ── */
#contenedorTabla {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* DataTables responsive: columna de expandir */
table.dataTable td.dtr-control,
table.dataTable th.dtr-control {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
}
table.dataTable td.dtr-control::before {
    content: '\f055';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #45b1af;
    font-size: 14px;
}
table.dataTable td.dtr-control.row-open::before {
    content: '\f056';
    color: #ef4444;
}

/* Ocultar columna de acciones en móvil (el menú⋯ la reemplaza) */
@media (max-width: 767px) {
    table.dataTable th:last-child,
    table.dataTable td:last-child {
        min-width: 50px !important;
        max-width: 50px !important;
        width: 50px !important;
    }
    /* Texto de celdas puede envolver en móvil */
    table.dataTable td {
        white-space: normal !important;
        word-break: break-word;
    }
}

/* Menú de acciones desplegable */
.action-menu-dropdown {
    transform-origin: top right;
    animation: menuFadeIn 0.15s ease;
}
@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* DataTables responsive child rows */
table.dataTable tr.dtr-group td {
    background: #f8fafc;
    padding: 12px 16px;
}
table.dataTable tr.dtr-group td::before {
    content: attr(data-dtr-title);
    font-weight: 600;
    color: #64748b;
    display: inline-block;
    min-width: 100px;
    margin-right: 8px;
}

/* Sidebar del sistema: links y grupo de navegación */
.app-sidebar-link {
    border-left: 4px solid transparent;
    transition: all .15s ease;
}
.app-sidebar-link.is-active {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-left-color: #fdba74; /* orange-300 */
}
.app-sidebar-link:not(.is-active) {
    color: #c7d2fe; /* indigo-200 */
}
.app-sidebar-link:not(.is-active):hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #fff;
}
/* Estilos para grupos del sidebar (solución JavaScript) */
.sidebar-group-header {
    user-select: none;
}

/* Animación suave para expansión/colapso */
.sidebar-group-body {
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    max-height: 0;
    opacity: 0;
}

.sidebar-group-body.expanded {
    max-height: 1000px; /* Suficiente para cualquier cantidad de elementos */
    opacity: 1;
}

.sidebar-group-body > ul {
    overflow: hidden;
    padding-top: 4px;
}

/* ============================================
   Gradientes para cabeceras contextuales de modales
   (Cargados dinámicamente vía AJAX, Tailwind CDN no los procesa)
   ============================================ */

.normal-header-gradient {
    background: linear-gradient(to right, var(--primary-teal), var(--accent-vibrant));
}
.consulta-header-gradient {
    background: linear-gradient(to right, #2c5eff, #074eaa);
}
.cirugia-header-gradient {
    background: linear-gradient(to right, #ee3d49, #ff9c23);
}

.hospitalizacion-header-gradient {
    background: linear-gradient(to right, #f5f3ff, #faf5ff);
}
.informe-gradient-header {
    background: linear-gradient(to right, #4f46e5, #2563eb);
}
.evolucion-gradient-header {
    background: linear-gradient(to right, #10b981, #059669);
}
.insumo-hosp-gradient-header {
    background: linear-gradient(to right, #7c3aed, #5b21b6);
}
.detalle-hosp-gradient-header {
    background: linear-gradient(to right, #0ea5e9, #0369a1);
}

/* ============================================
   Estilos del Login (vista de 2 paneles)
   - Fondo con degradado animado usando los
     colores del sistema.
   - Panel izquierdo: información.
   - Panel derecho: formulario + botón
     "recuperar contraseña" (no funcional).
   ============================================ */

/* Reset de márgenes en el body para que el degradado cubra toda la pantalla */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--primary-dark); /* fallback mientras carga el degradado */
    overflow-x: hidden;
}

/* Contenedor principal del login: pantalla completa, centra el card de 2 paneles */
.login-main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    position: relative;
    min-height: 100vh;
    width: 100%;
}

/* Fondo con degradado animado que cubre todo el viewport.
   Usa los 4 colores del sistema (primary-dark, primary-teal, accent-vibrant, accent-soft)
   y un background-size mayor al viewport + animación del background-position
   para conseguir el efecto de movimiento suave. */
.login-bg-animated {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        135deg,
        #16213e 0%,
        #008fb3 25%,
        #45b1af 50%,
        #008fb3 75%,
        #16213e 100%
    );
    background-size: 300% 300%;
    animation: loginGradientMove 18s ease-in-out infinite;
    pointer-events: none;
}

/* Segunda capa para dar profundidad y movimiento al fondo */
.login-bg-animated::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 20% 30%,
        rgba(254, 200, 153, 0.726) 0%,
        transparent 45%
    ),
    radial-gradient(
        circle at 80% 70%,
        rgba(4, 255, 251, 0.644) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 50% 50%,
        rgba(5, 31, 109, 0.651) 0%,
        transparent 60%
    );
    background-size: 200% 200%;
    animation: loginGradientOrbs 14s ease-in-out infinite alternate;
}

/* Keyframes del degradado principal */
@keyframes loginGradientMove {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 50% 100%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

/* Keyframes de los orbes que se mueven en el fondo */
@keyframes loginGradientOrbs {
    0%   { background-position: 0% 0%; transform: scale(1); }
    50%  { background-position: 100% 100%; transform: scale(1.1); }
    100% { background-position: 50% 50%; transform: scale(1); }
}

/* Contenedor del card con los 2 paneles (info + form) */
.login-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 980px;
    min-height: 560px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.75rem;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(22, 33, 62, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    animation: loginCardAppear 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Animación de aparición del card */
@keyframes loginCardAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* En pantallas grandes, layout de 2 columnas */
@media (min-width: 768px) {
    .login-container {
        grid-template-columns: 1.05fr 1fr;
    }
}

/* Panel izquierdo: información del sistema */
.login-info-panel {
    position: relative;
    padding: 2.5rem 2rem;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(22, 33, 62, 0.92) 0%, rgba(0, 143, 179, 0.92) 100%),
        radial-gradient(circle at 20% 20%, rgba(254, 200, 153, 0.3), transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

/* Decoración con círculos en el panel de información */
.login-info-panel::before,
.login-info-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.login-info-panel::before {
    width: 220px; height: 220px;
    top: -80px; right: -80px;
    background: rgba(254, 200, 153, 0.15);
    filter: blur(8px);
}
.login-info-panel::after {
    width: 160px; height: 160px;
    bottom: -60px; left: -40px;
    background: rgba(69, 177, 175, 0.4);
    filter: blur(6px);
}

.login-info-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.login-info-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}
.login-info-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.login-info-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}
.login-info-title span {
    color: var(--accent-soft);
}
.login-info-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}
.login-info-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

/* Lista de características / beneficios */
.login-info-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.login-info-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.88rem;
}
.login-info-features li i {
    color: var(--accent-soft);
    font-size: 1rem;
    width: 22px;
    text-align: center;
}

.login-info-footer {
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.05em;
}

/* Panel derecho: formulario */
.login-form-panel {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.login-form-header {
    margin-bottom: 1.75rem;
}
.login-form-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}
.login-form-subtitle {
    color: #64748b;
    font-size: 0.9rem;
}

/* Inputs del formulario */
.login-input-group {
    margin-bottom: 1.1rem;
}
.login-input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}
.login-input-wrapper {
    position: relative;
}
.login-input-icon {
    position: absolute;
    inset: 0 0 0 0.85rem;
    display: flex;
    align-items: center;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}
.login-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.6rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.85rem;
    font-size: 0.92rem;
    color: var(--primary-dark);
    transition: all 0.2s ease;
    outline: none;
}
.login-input::placeholder { color: #94a3b8; }
.login-input:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}
.login-input:focus {
    border-color: var(--accent-vibrant);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(69, 177, 175, 0.15);
}
.login-input:focus + .login-input-icon,
.login-input-wrapper:focus-within .login-input-icon {
    color: var(--accent-vibrant);
}

/* Botón principal de "Acceder al Sistema" */
.login-submit-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.95rem 1rem;
    background: linear-gradient(135deg, var(--accent-vibrant) 0%, var(--primary-teal) 100%);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: none;
    border-radius: 0.85rem;
    cursor: pointer;
    box-shadow:
        0 10px 25px -8px rgba(0, 143, 179, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 30px -8px rgba(0, 143, 179, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    filter: brightness(1.05);
}
.login-submit-btn:active { transform: translateY(0); }

/* Separador con "ó" */
.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0 0.5rem;
    color: #94a3b8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Botón "Recuperar contraseña" (no funcional) */
.login-forgot-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: transparent;
    color: var(--primary-teal);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.login-forgot-btn:hover {
    border-color: var(--accent-vibrant);
    background: rgba(69, 177, 175, 0.08);
    color: var(--primary-teal);
    transform: translateY(-1px);
}
.login-forgot-btn:active { transform: translateY(0); }

/* Mensaje de error */
.login-error {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: 0.6rem;
}

/* Footer de copyright del card de login */
.login-form-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Versión móvil: oculta el panel de información */
@media (max-width: 767px) {
    .login-info-panel { display: none; }
    .login-container { max-width: 440px; min-height: auto; }
    .login-form-panel { padding: 2rem 1.5rem; }
    .login-form-title { font-size: 1.4rem; }
}

/* Respeta la preferencia de reducir movimiento: detiene las animaciones del degradado */
@media (prefers-reduced-motion: reduce) {
    .login-bg-animated,
    .login-bg-animated::before {
        animation: none;
    }
    .login-container { animation: none; }
}

/* ============================================================
   Validación en tiempo real
   ============================================================ */

/* ============================================================
   Estilos de Cubículos – Vista tipo "Celdas"
   ============================================================ */

/* ── Celda base ── */
.celda-cubiculo {
    position: relative;
    background: #ffffff;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    min-height: 200px;
}

.celda-cubiculo:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
}

/* ── Bordes por estado ── */
.celda-border-disponible { border-color: #bbf7d0; }
.celda-border-disponible:hover { border-color: #4ade80; }

.celda-border-ocupada { border-color: #fed7aa; }
.celda-border-ocupada:hover { border-color: #fb923c; }

.celda-border-limpieza { border-color: #bfdbfe; }
.celda-border-limpieza:hover { border-color: #60a5fa; }

.celda-border-mantenimiento { border-color: #fecaca; }
.celda-border-mantenimiento:hover { border-color: #f87171; }
.celda-border-inactivo { border-color: #cbd5e1; border-style: dashed; }
.celda-border-inactivo:hover { border-color: #94a3b8; }
.celda-badge-inactivo {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* ── Badge de estado ── */
.celda-badge-container {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    justify-content: flex-start;
}

.celda-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.celda-badge-disponible {
    background: #dcfce7;
    color: #16a34a;
}

.celda-badge-ocupada {
    background: #ffedd5;
    color: #ea580c;
}

.celda-badge-limpieza {
    background: #dbeafe;
    color: #2563eb;
}

.celda-badge-mantenimiento {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Código / nombre ── */
.celda-codigo {
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e293b;
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

/* ── Contenido central ── */
.celda-contenido {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.25rem 0;
}

/* Foto de la mascota */
.celda-foto-container {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #f1f5f9;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.4rem;
    transition: transform 0.2s ease;
}

.celda-cubiculo:hover .celda-foto-container {
    transform: scale(1.08);
    border-color: #cbd5e1;
}

.celda-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.celda-mascota-nombre {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
}

.celda-mascota-raza {
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Ícono de celda vacía */
.celda-vacia-icono {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
    transition: all 0.25s ease;
}

.celda-cubiculo:hover .celda-vacia-icono {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.celda-vacia-texto {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ── Footer de la celda ── */
.celda-footer {
    width: 100%;
    padding-top: 0.4rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 0.3rem;
}

.celda-tamano {
    font-size: 0.6rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Acciones overlay ── */
.celda-acciones {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(255,255,255,0.97) 60%, rgba(255,255,255,0) 100%);
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.celda-cubiculo:hover .celda-acciones {
    transform: translateY(0);
}

.celda-accion-btn {
    width: 28px;
    height: 28px;
    border-radius: 0.5rem;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.15);
}

.celda-accion-btn:hover {
    transform: scale(1.1);
}

.celda-accion-btn:active {
    transform: scale(0.95);
}

/* ── Animación de entrada ── */
@keyframes celdaAparicion {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.celda-cubiculo {
    animation: celdaAparicion 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Escalonar la animación */
.celda-cubiculo:nth-child(1)  { animation-delay: 0.00s; }
.celda-cubiculo:nth-child(2)  { animation-delay: 0.03s; }
.celda-cubiculo:nth-child(3)  { animation-delay: 0.06s; }
.celda-cubiculo:nth-child(4)  { animation-delay: 0.09s; }
.celda-cubiculo:nth-child(5)  { animation-delay: 0.12s; }
.celda-cubiculo:nth-child(6)  { animation-delay: 0.15s; }
.celda-cubiculo:nth-child(7)  { animation-delay: 0.18s; }
.celda-cubiculo:nth-child(8)  { animation-delay: 0.21s; }
.celda-cubiculo:nth-child(9)  { animation-delay: 0.24s; }
.celda-cubiculo:nth-child(10) { animation-delay: 0.27s; }
.celda-cubiculo:nth-child(11) { animation-delay: 0.30s; }
.celda-cubiculo:nth-child(12) { animation-delay: 0.33s; }

/* Borde rojo en inputs con error */
.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .15) !important;
}

/* Mensaje de error: transición suave */
.error-msg {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity .25s ease, max-height .3s ease, margin .2s ease;
    margin-top: 0;
}
.error-msg.visible {
    opacity: 1;
    max-height: 80px;   /* suficiente para 1 línea de texto */
    margin-top: .5rem;
}

/* ============================================================
   Estilos de Mascotas – Vista tipo "Cartas"
   ============================================================ */

/* ── Animación de entrada ── */
@keyframes mascotaCardAparicion {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mascota-card {
    animation: mascotaCardAparicion 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Escalonar la animación */
.mascota-card:nth-child(1)  { animation-delay: 0.00s; }
.mascota-card:nth-child(2)  { animation-delay: 0.04s; }
.mascota-card:nth-child(3)  { animation-delay: 0.08s; }
.mascota-card:nth-child(4)  { animation-delay: 0.12s; }
.mascota-card:nth-child(5)  { animation-delay: 0.16s; }
.mascota-card:nth-child(6)  { animation-delay: 0.20s; }
.mascota-card:nth-child(7)  { animation-delay: 0.24s; }
.mascota-card:nth-child(8)  { animation-delay: 0.28s; }
.mascota-card:nth-child(9)  { animation-delay: 0.32s; }
.mascota-card:nth-child(10) { animation-delay: 0.36s; }
.mascota-card:nth-child(11) { animation-delay: 0.40s; }
.mascota-card:nth-child(12) { animation-delay: 0.44s; }





/* ============================================
   Clases para rotación de flechas del sidebar
   Compatible con todos los navegadores
   ============================================ */

/* Clase para rotar flechas cuando el grupo está expandido */
.sidebar-group-header.expanded svg {
    transform: rotate(180deg);
}

/* Transición suave para la rotación */
.sidebar-group-header svg {
    transition: transform 0.2s ease;
}


/* ============================================
   Scroll básico para sidebar
   ============================================ */

.sidebar-nav-scroll {
    overflow-y: auto;
    max-height: calc(100vh - 180px);
    scroll-behavior: smooth;
}


/* ============================================
   Estilos para búsqueda en sidebar
   ============================================ */

#sidebarSearch {
    transition: all 0.2s ease;
}

#sidebarSearch:focus {
    box-shadow: 0 0 0 2px rgba(254, 200, 153, 0.3) !important;
}

#clearSearch {
    transition: color 0.2s ease;
}

/* Highlight para resultados de búsqueda */
.search-highlight {
    background-color: rgba(254, 200, 153, 0.2) !important;
    color: #fec899 !important;
    border-radius: 8px;
}

/* Ocultar grupos sin resultados */
.app-sidebar-group.search-hidden {
    display: none !important;
}

/* ============================================================
   Estilos para la barra de búsqueda en Razas
   ============================================================ */

/* Botón de limpieza en campo de búsqueda */
.btn-limpiar-busqueda {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-limpiar-busqueda:hover {
    background: #f1f5f9;
    transform: scale(1.1);
}

.btn-limpiar-busqueda:active {
    transform: scale(0.95);
}

.btn-limpiar-busqueda.hidden {
    display: none;
}

/* Mejora visual para el campo de búsqueda con botón de limpieza */
#buscadorRazas:not(:placeholder-shown) ~ .btn-limpiar-busqueda {
    display: flex;
}

#buscadorRazas:placeholder-shown ~ .btn-limpiar-busqueda {
    display: none;
}

/* Scrollbar personalizado para el menú de especies/razas */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   Modal Animations with @keyframes
   Reemplaza las clases utilitarias de Tailwind
   (opacity-*, translate-y-*, scale-*, transition-*)
   ============================================ */

/* ── Estado inicial (oculto) ── */
.backdrop-modal {
    opacity: 0;
}

.container-modal {
    opacity: 0;
    transform: translateY(16px);
}

@media (min-width: 640px) {
    .container-modal {
        transform: scale(0.95);
    }
}

/* ── Estado final tras animación de entrada ── */
.backdrop-modal.modal-backdrop-in {
    opacity: 1;
}

.container-modal.modal-backdrop-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── Keyframes: Backdrop ── */
@keyframes modal-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-backdrop-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ── Keyframes: Container (mobile: slide up) ── */
@keyframes modal-container-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes modal-container-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(16px); }
}

/* ── Keyframes: Container (desktop sm+: scale) ── */
@media (min-width: 640px) {
    @keyframes modal-container-in {
        from { opacity: 0; transform: scale(0.95); }
        to   { opacity: 1; transform: scale(1); }
    }

    @keyframes modal-container-out {
        from { opacity: 1; transform: scale(1); }
        to   { opacity: 0; transform: scale(0.95); }
    }
}

/* ── Clases de animación ── */
.modal-backdrop-in {
    animation: modal-backdrop-in 200ms ease-out forwards;
}

.modal-backdrop-out {
    animation: modal-backdrop-out 200ms ease-out forwards;
}

.modal-container-in {
    animation: modal-container-in 200ms ease-out forwards;
}

.modal-container-out {
    animation: modal-container-out 200ms ease-out forwards;
}

/* ── Spotlight / Omnisearch ── */
#spotlight-overlay {
    animation: spotlight-fade-in 150ms ease-out;
}
#spotlight-overlay > div {
    animation: spotlight-slide-in 200ms ease-out;
}
.spotlight-active {
    background-color: rgb(241 245 249) !important;
}
#spotlight-results::-webkit-scrollbar {
    width: 6px;
}
#spotlight-results::-webkit-scrollbar-track {
    background: transparent;
}
#spotlight-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

@keyframes spotlight-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes spotlight-slide-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Sidebar tooltips ── */
.nav-item {
    position: relative;
}
.nav-item .nav-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 5px 10px;
    background: var(--primary-dark);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.nav-item .nav-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--primary-dark);
}
.nav-item:hover .nav-tooltip {
    opacity: 1;
}

/* ── Hover effects en filas de tabla ── */
table.dataTable tbody tr {
    transition: background-color 150ms ease, box-shadow 150ms ease;
    cursor: pointer;
}
table.dataTable tbody tr:hover {
    background-color: rgb(241 245 249) !important;
    box-shadow: inset 3px 0 0 var(--primary-teal);
}

/* ── Badges de estado estandarizados ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-primary { background: #e0f2fe; color: #075985; }
.badge i { font-size: 8px; }

/* ── Scrollbar personalizado ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Skeleton pulse animation ── */
@keyframes skeleton-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* ── Estadísticas inline en headers de tabla ── */
.table-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 0;
}
.table-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
}
.table-stat-item .stat-value {
    font-weight: 700;
    color: #1e293b;
}

/* ── Lazy loading fade-in ── */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 300ms ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([data-src]) {
    opacity: 1;
}

/* ============================================================
   Seguimiento – Timeline vertical de servicios
   ============================================================ */
.sep-timeline-item:last-child .sep-timeline-line {
    display: none;
}
.sep-timeline-item:last-child .sep-timeline-dot {
    box-shadow: 0 0 0 4px white, 0 0 0 5px #e2e8f0;
}
.sep-timeline-item .sep-timeline-dot {
    transition: transform 0.2s ease;
}
.sep-timeline-item:hover .sep-timeline-dot {
    transform: scale(1.1);
}
.sep-card-insumos-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 0.75rem;
}

/* ── Print-friendly ── */
@media print {
    .no-print,
    .menu-lateral,
    header,
    .sidebar,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dataTables_info,
    #spotlight-overlay,
    #toast-container,
    .btn,
    button {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    .bg-vt-primary { background: white !important; }
    table { width: 100% !important; }
    table.dataTable { border: 1px solid #ddd !important; }
    table.dataTable th,
    table.dataTable td {
        border: 1px solid #ddd !important;
        padding: 6px 8px !important;
        font-size: 11pt;
    }
    table.dataTable th { background: #f3f4f6 !important; font-weight: bold; }
    .container-modal, .fixed { position: static !important; }
    a { text-decoration: none; color: black; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
    .print-break { page-break-before: always; }
}
