/* =============================================================================
   Clientes SAP — estilos propios
   -----------------------------------------------------------------------------
   Bootstrap primero: acá solo va la identidad de marca y lo que Bootstrap no
   resuelve (el paso a paso, la barra de pipeline, el combo con buscador y la
   línea de tiempo). Antes de escribir algo nuevo acá, revisa si Bootstrap ya
   lo cubre con utilidades.
   ========================================================================== */

:root {
    --ft-azul: #14456f;
    --ft-azul-claro: #1d5c93;
    --ft-rojo: #b3242c;
    --ft-linea: #e3e8ef;
    --ft-tinta-suave: #63748c;
}

body {
    background-color: #f5f7fa;
    color: #101828;
}

.crumb {
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ft-tinta-suave);
}

/* Filete de marca en el borde superior. */
.brand-rule {
    height: 3px;
    background: linear-gradient(90deg, var(--ft-azul) 0%, var(--ft-azul-claro) 60%, var(--ft-rojo) 100%);
}

/* ── Barra superior ───────────────────────────────────────────────────────── */

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--ft-linea);
}

.topbar__home {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    color: var(--ft-azul);
    text-decoration: none;
}

.topbar__mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--ft-azul);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
}

.topbar__nav .nav-link {
    color: #344054;
    padding: .35rem .7rem;
    border-radius: 7px;
    font-size: .9rem;
}

.topbar__nav .nav-link:hover {
    background: #eef2f7;
}

.topbar__nav .nav-link.active {
    background: var(--ft-azul);
    color: #fff;
}

.topbar__nav .nav-link i {
    margin-right: .35rem;
}

.topbar__user {
    font-size: .85rem;
    line-height: 1.2;
}

.topbar__role {
    font-size: .74rem;
    color: var(--ft-tinta-suave);
}

/* ── Pantalla de acceso ───────────────────────────────────────────────────── */

.acceso__caja {
    width: min(460px, 100%);
    padding: 0 1rem;
}

.acceso__marca {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--ft-azul);
    color: #fff;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ── Tarjetas de indicador ────────────────────────────────────────────────── */

.kpi__label {
    font-size: .74rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ft-tinta-suave);
    margin-bottom: .35rem;
}

.kpi__value {
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0;
}

.kpi--accion {
    border-left: 3px solid var(--ft-rojo);
}

/* ── Barra de distribución por estado ─────────────────────────────────────── */

.pipeline {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: #eef2f7;
}

.pipeline__seg {
    height: 100%;
}

.leyenda {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.leyenda__n {
    font-variant-numeric: tabular-nums;
    color: #344054;
    font-size: .85rem;
}

/* ── Paso a paso del detalle ──────────────────────────────────────────────── */

.stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.stepper__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--ft-tinta-suave);
    font-size: .85rem;
}

.stepper__punto {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--ft-linea);
    background: #fff;
    font-size: .78rem;
}

.stepper__item.is-hecho .stepper__punto {
    background: var(--ft-azul);
    border-color: var(--ft-azul);
    color: #fff;
}

.stepper__item.is-actual {
    color: #101828;
    font-weight: 600;
}

.stepper__item.is-actual .stepper__punto {
    border-color: var(--ft-azul);
    border-width: 2px;
    color: var(--ft-azul);
}

/* ── Bloques del formulario y de solo lectura ─────────────────────────────── */

.paso {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--ft-azul);
    color: #fff;
    font-size: .72rem;
    margin-right: .4rem;
}

.dato {
    display: flex;
    flex-direction: column;
}

.dato__label {
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ft-tinta-suave);
}

.dato__valor {
    font-size: .92rem;
    word-break: break-word;
}

/* ── Combo con buscador ───────────────────────────────────────────────────── */

.combo {
    position: relative;
}

.combo__panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--ft-linea);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
}

.combo__item {
    padding: .4rem .7rem;
    font-size: .88rem;
    cursor: pointer;
}

.combo__item:hover,
.combo__item.is-marcado {
    background: #eef2f7;
}

.combo__vacio {
    padding: .5rem .7rem;
    font-size: .85rem;
    color: var(--ft-tinta-suave);
}

/* ── Línea de tiempo ──────────────────────────────────────────────────────── */

.linea-tiempo {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--ft-linea);
}

.linea-tiempo__item {
    position: relative;
    padding: 0 0 1rem 1rem;
}

.linea-tiempo__item::before {
    content: "";
    position: absolute;
    left: -6px;
    top: .35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ft-azul);
}

.linea-tiempo__accion {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
}

.linea-tiempo__meta {
    margin: 0;
    font-size: .76rem;
    color: var(--ft-tinta-suave);
}

.linea-tiempo__nota {
    margin: .35rem 0 0;
    padding: .35rem .6rem;
    font-size: .82rem;
    background: #fdf1da;
    border-left: 3px solid #b57708;
    border-radius: 0 6px 6px 0;
}

/* ── Página del flujo ─────────────────────────────────────────────────────── */

.carril {
    border: 1px solid var(--ft-linea);
    border-radius: 10px;
    padding: .85rem;
    background: #fff;
}

.carril__titulo {
    font-size: .74rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ft-tinta-suave);
    margin-bottom: .6rem;
}

.carril__estado + .carril__estado {
    margin-top: .7rem;
}

.regla {
    border-left: 3px solid var(--ft-azul);
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    padding: .6rem .85rem;
    font-size: .88rem;
    height: 100%;
}

.regla--aviso {
    border-left-color: #b57708;
    background: #fdf1da;
}

/* ── Impresión ────────────────────────────────────────────────────────────── */

@media print {
    .no-print,
    .topbar,
    .brand-rule {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .card {
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
}

/* Tarjetas de opción del panel: el punto de partida al entrar. */
.opcion {
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.opcion:hover,
.opcion:focus-visible {
    border-color: var(--bs-primary);
    box-shadow: 0 .35rem .9rem rgba(20, 69, 111, .12);
    transform: translateY(-1px);
}
