/* ================================================================
   CASBI SALUD — custom.css
   Utilidades globales y Sistema de Botones con Iconos.
   ================================================================ */

/* --- Brand colors --- */
:root {
    --casbi-teal: #116a7e;
    --casbi-accent: #0dd3c5;
}

/* Heading brand color */
h2, h3 { color: var(--casbi-teal) !important; }
.text-primary { color: var(--casbi-teal) !important; }

/* ---- Utilities ---- */
.btn-flotante { position: fixed; bottom: 80px; right: 5px; z-index: 9; }
.container-1920 { max-width: 1920px; }
.container-800 { max-width: 800px; }

/* ---- WhatsApp inline button ---- */
.wpp-link {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem 1.4rem; background: #25d366;
    color: #fff; text-decoration: none; border-radius: 10px;
    font-weight: 700; transition: background .3s, transform .3s;
}
.wpp-link:hover { background: #128c7e; transform: scale(1.05); color: #fff; }
.wpp-link i { font-size: 1.4rem; color: #fff; }

/* ---- Mapa heredado ---- */
.map-container { padding: 0; margin: 0; width: 100%; }
.map-container iframe { width: 100%; max-width: 100%; height: 450px; border: 0; display: block; }

/* ================================================================
   REGLAS GLOBALES DEL SISTEMA PARA BOTONES CON ICONOS
   ================================================================ */

/* Botón de Ir Atrás (Volver) */
a.btn-back,
.btn-back,
a[title*="Volver"],
a[href*="dashboard"].btn-back-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding-left: 1.25rem !important;  /* 20px espacio seguro a la izquierda */
    padding-right: 1.25rem !important; /* 20px espacio seguro a la derecha */
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
    background-color: #0f172a !important; /* Alto contraste Slate-900 */
    color: #ffffff !important;
    border-radius: 0.75rem !important; /* 12px rounded-xl */
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    flex-shrink: 0 !important;
    transition: opacity 0.2s ease-in-out !important;
}

a.btn-back:hover,
.btn-back:hover,
a[title*="Volver"]:hover {
    opacity: 0.9 !important;
    color: #ffffff !important;
}

/* Icono del botón Volver: Margen seguro que nunca toca el borde */
a.btn-back i,
.btn-back i,
a[title*="Volver"] i {
    margin-right: 0.35rem !important;
    margin-left: 0.15rem !important;
    flex-shrink: 0 !important;
    font-size: 0.75rem !important;
    color: #ffffff !important;
}

/* Prevenir que cualquier icono dentro de un botón flex colapse */
button i,
a.btn i,
.btn i {
    flex-shrink: 0 !important;
}

/* ================================================================
   REGLAS GLOBALES DE IMPRESIÓN (PDF / PRINT SYSTEM-WIDE)
   ================================================================ */
@media print {
    /* Ocultar Navbar, Drawer, Footer, WhatsApp flotante y elementos web */
    nav, header, footer,
    .casbi-nav, .casbi-drawer, .whatsapp-float, .btn-flotante,
    .print\:hidden, #casbiNav, [role="navigation"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }

    /* Anular padding-top del body generado por el navbar fijo */
    html, body {
        padding-top: 0 !important;
        margin-top: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
        width: 100% !important;
    }

    /* Resetear wrappers principales */
    .min-h-screen, main {
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        min-height: auto !important;
    }
}