/* ============================================================
   BENTO DESIGN SYSTEM — Portal ESRI (alineado con BuenTrato.AI)
   ------------------------------------------------------------
   Este archivo agrega utilities con prefijo bt- al portal ESRI
   para alinearlo con el sistema bento del portal disc.buentrato.ai.

   Es ADITIVO: no reemplaza assets/styles.css. Solo agrega clases
   nuevas que se pueden usar progresivamente página por página.

   Cómo incluirlo:
     <link rel="stylesheet" href="/assets/styles.css">
     <link rel="stylesheet" href="/assets/bento-system.css">

   Reglas críticas (no romper):
   - Carita / logos: SIEMPRE max-height + width:auto + object-fit:contain.
     NUNCA filtros, NUNCA opacity excepto en estados muy explícitos.
   - Paleta: solo 2 colores principales + tonos. No inventar colores.
   - Nombres DISC: nunca D/I/S/C en UI visible — usar "Directo /
     Sociable / Estable / Metódico".
   ============================================================ */


/* ============================================================
   1. VARIABLES — paleta, sombras, tipografía
   Las variables --bt-* son alias amigables sobre las existentes
   --color-* del portal ESRI. Esto permite usar el mismo nombre
   que el portal DISC sin romper estilos viejos.
   ============================================================ */
:root {
    /* Colores principales */
    --bt-primary:        #0380A6;
    --bt-primary-hover:  #026B8A;
    --bt-primary-deeper: #01516A;
    --bt-primary-soft:   #E6F4F9;
    --bt-accent:         #04B5D6;
    --bt-accent-light:   #6DCFE0;
    --bt-gris:           #777579;
    --bt-gris-soft:      #F4F4F4;

    /* Backgrounds */
    --bt-bg:             #ECEBEB;
    --bt-bg-page:        #FFFFFF;
    --bt-white:          #FFFFFF;
    --bt-border:         #ECEBEB;
    --bt-border-soft:    #DDD9D9;

    /* Estados */
    --bt-ok:        #22C55E;
    --bt-ok-soft:   rgba(34, 197, 94, 0.12);
    --bt-pendiente: #F59E0B;
    --bt-pendiente-soft: rgba(245, 158, 11, 0.13);
    --bt-error:     #E53E3E;

    /* Sombras */
    --bt-shadow-soft:   0 1px 3px rgba(15, 35, 55, 0.04), 0 4px 16px rgba(15, 35, 55, 0.04);
    --bt-shadow-hover:  0 4px 12px rgba(3, 128, 166, 0.08), 0 16px 40px rgba(15, 35, 55, 0.08);
    --bt-shadow-coach:  0 12px 36px rgba(3, 128, 166, 0.20);

    /* Radios */
    --bt-radius-card: 22px;
    --bt-radius-pill: 999px;

    /* Espaciados */
    --bt-gap: 14px;
}


/* ============================================================
   2. PILL TABS — navegación principal por rol
   ------------------------------------------------------------
   Las tabs viven visualmente "pegadas" al header. Para evitar
   que floten en el espacio blanco con waves, tienen fondo
   blanco y se conectan con el header de arriba. Ocupan toda
   la página de ancho (no flotan en el centro vacío).
   ============================================================ */
.bt-pill-tabs-wrap {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 0 24px 16px;
    margin: 0;
    background: var(--bt-white);
    /* Sombra inferior sutil para separar visualmente del contenido siguiente,
       en vez del fondo blanco con waves que dejaba a las tabs flotando. */
    box-shadow: 0 1px 0 var(--bt-border), 0 6px 16px -8px rgba(15, 35, 55, 0.06);
}
.bt-pill-tabs {
    display: inline-flex;
    justify-content: center;
    gap: 4px;
    background: var(--bt-gris-soft);
    padding: 4px;
    border-radius: var(--bt-radius-pill);
}
.bt-pill-tab {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bt-gris);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border-radius: var(--bt-radius-pill);
    background: transparent;
    border: none;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bt-pill-tab:hover { color: var(--bt-primary); }
.bt-pill-tab.active {
    color: var(--bt-primary);
    background: var(--bt-white);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 35, 55, 0.08);
}
.bt-pill-tab .bt-pill-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Cuando un .app-header va seguido directamente de .bt-pill-tabs-wrap,
   eliminar el padding-bottom del header para que ambos se sientan una
   sola unidad visualmente. */
.app-header.app-header-clean:has(+ .bt-pill-tabs-wrap),
.app-header:has(+ .bt-pill-tabs-wrap) {
    padding-bottom: 8px;
    background: var(--bt-white);
}

/* Mobile: pill-tabs siguen centradas pero con scroll horizontal si no caben */
@media (max-width: 600px) {
    .bt-pill-tabs-wrap {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 16px 12px;
        scrollbar-width: none;
    }
    .bt-pill-tabs-wrap::-webkit-scrollbar { display: none; }
    .bt-pill-tab { padding: 7px 14px; font-size: 12px; }
}


/* ============================================================
   3. FOOTER institucional (igual que portal DISC)
   ============================================================ */
.bt-footer {
    position: relative;
    z-index: 2;
    background: transparent;
    color: var(--bt-gris);
    padding: 24px 32px 32px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-top: 1px solid var(--bt-border);
    max-width: 1200px;
    margin: 48px auto 0;
}
.bt-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bt-footer-brand img {
    max-height: 28px;
    width: auto;
    object-fit: contain;
    opacity: 0.8;
}
.bt-footer-brand-text {
    font-size: 12px;
    color: var(--bt-gris);
    line-height: 1.4;
}
.bt-footer-brand-text strong {
    color: var(--bt-primary);
    font-weight: 600;
}
.bt-footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.bt-footer-links a {
    color: var(--bt-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.bt-footer-links a:hover {
    color: var(--bt-primary-hover);
    text-decoration: underline;
}
.bt-footer-links .bt-footer-sep {
    color: var(--bt-border-soft);
    user-select: none;
}
.bt-footer-icon {
    color: var(--bt-gris);
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}
.bt-footer-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.bt-footer-icon:hover { color: var(--bt-primary); }

@media (max-width: 600px) {
    .bt-footer {
        padding: 20px 16px 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}


/* ============================================================
   4. CARDS / WIDGETS bento (alternativa a .card y .grid-card)
   ============================================================ */
.bt-card {
    background: var(--bt-white);
    border-radius: var(--bt-radius-card);
    padding: 20px;
    box-shadow: var(--bt-shadow-soft);
    border: 1px solid var(--bt-border-soft);
    transition: transform 0.25s, box-shadow 0.25s;
    overflow: hidden;
    position: relative;
}
.bt-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bt-shadow-hover);
}
.bt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.bt-card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--bt-gris);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bt-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--bt-primary);
    letter-spacing: -0.3px;
    line-height: 1.25;
    margin: 0 0 6px;
}
.bt-card-sub {
    font-size: 13px;
    color: var(--bt-gris);
    line-height: 1.45;
    margin: 0;
}


/* ============================================================
   5. TAGS de estado
   ============================================================ */
.bt-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--bt-radius-pill);
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.bt-tag::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
}
.bt-tag.ok        { background: var(--bt-ok-soft);        color: var(--bt-ok); }
.bt-tag.ok::before        { background: var(--bt-ok); }
.bt-tag.pending   { background: var(--bt-pendiente-soft); color: var(--bt-pendiente); }
.bt-tag.pending::before   { background: var(--bt-pendiente); }
.bt-tag.disc      { background: var(--bt-primary-soft);  color: var(--bt-primary-deeper); }
.bt-tag.disc::before      { background: var(--bt-primary); }


/* ============================================================
   6. BOTONES bento
   ============================================================ */
.bt-btn {
    background: var(--bt-primary);
    color: var(--bt-white);
    border: none;
    border-radius: var(--bt-radius-pill);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 80ms;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.bt-btn:hover  { background: var(--bt-primary-hover); }
.bt-btn:active { transform: translateY(1px); }
.bt-btn.outline {
    background: var(--bt-white);
    color: var(--bt-primary);
    border: 1.5px solid var(--bt-primary);
}
.bt-btn.outline:hover { background: var(--bt-primary-soft); }
.bt-btn.small { padding: 7px 14px; font-size: 12px; }
.bt-btn.large { padding: 12px 24px; font-size: 14px; }


/* ============================================================
   7. ANILLOS APPLE WATCH (concéntricos) — para futuro DISC embebido
   ============================================================ */
.bt-ring-svg {
    transform: rotate(-90deg);
}
.bt-ring-track {
    fill: none;
    stroke: var(--bt-bg);
}
.bt-ring-fill {
    fill: none;
    stroke: var(--bt-primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}


/* ============================================================
   8. LOGO HELPERS
   ============================================================ */
.bt-logo-img {
    max-height: 56px;
    width: auto;
    object-fit: contain;
    display: block;
}
.bt-logo-img.small  { max-height: 28px; }
.bt-logo-img.medium { max-height: 44px; }
.bt-logo-img.large  { max-height: 80px; }
/* NUNCA aplicar filter, opacity, transform que altere proporciones */


/* ============================================================
   9. CARITA COACH grande (para coach widget en dashboards futuros)
   ============================================================ */
.bt-coach-avatar {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: var(--bt-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--bt-shadow-coach);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    animation: bt-breathe 3s ease-in-out infinite;
    cursor: pointer;
}
.bt-coach-avatar img {
    max-height: 72px;
    width: auto;
    object-fit: contain;
    display: block;
}
.bt-coach-avatar::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid var(--bt-primary);
    animation: bt-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
}
@keyframes bt-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}
@keyframes bt-ping {
    0%   { transform: scale(1);   opacity: 0.7; }
    80%, 100% { transform: scale(1.4); opacity: 0; }
}


/* ============================================================
   10. ESCALAS DE TIPOGRAFÍA
   ============================================================ */
.bt-h1 {
    font-size: 28px; font-weight: 600; color: var(--bt-primary);
    letter-spacing: -0.6px; line-height: 1.15; margin: 0;
}
.bt-h2 {
    font-size: 22px; font-weight: 600; color: var(--bt-primary);
    letter-spacing: -0.4px; line-height: 1.2; margin: 0;
}
.bt-h3 {
    font-size: 17px; font-weight: 600; color: var(--bt-primary-deeper);
    letter-spacing: -0.2px; line-height: 1.25; margin: 0;
}
.bt-body  { font-size: 14px; color: var(--bt-gris); line-height: 1.5; }
.bt-small { font-size: 12px; color: var(--bt-gris); line-height: 1.4; }


/* ============================================================
   11. NO IMPRIMIR — el footer y las tabs no se imprimen en PDF
   El informe.html ya oculta .app-header con .no-print. Aquí
   replicamos el patrón para los componentes nuevos.
   ============================================================ */
@media print {
    .bt-pill-tabs-wrap, .bt-footer {
        display: none !important;
    }
}
