/* ==========================================================================
   eleckai — tema visual (tokens de docs/08-ui-ux.md)
   Estética KIA: minimalista, mucho blanco, negro, gris claro, esquinas
   redondeadas. Complementa a Bootstrap 5; no usa frameworks de utilidades.
   ========================================================================== */

:root {
    --el-bg: #ffffff;
    --el-text: #0a0a0a;
    --el-text-muted: #737378;
    --el-surface: #f7f7f8;
    --el-surface-2: #f1f1f3;
    --el-border: #ececed;
    --el-border-strong: #dcdce0;
    --el-accent: #0a0a0a;        /* monocromo premium: el acento es el negro */
    --el-success: #1a7f4b;
    --el-error: #c0392b;

    --el-radius: 14px;
    --el-radius-sm: 10px;
    --el-space-1: 4px;
    --el-space-2: 8px;
    --el-space-3: 16px;
    --el-space-4: 24px;
    --el-space-5: 40px;

    --el-shadow: 0 1px 2px rgba(10, 10, 10, 0.04);
    --el-shadow-lg: 0 12px 32px rgba(10, 10, 10, 0.08);
    --el-bottomnav-h: 62px;
    --el-topbar-h: 68px;
}

body {
    background: var(--el-bg);
    color: var(--el-text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* --- Barra superior --- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--el-border);
}
.app-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--el-space-4);
    height: var(--el-topbar-h);
}

.app-brand,
.app-sidebar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--el-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.app-brand-logo { height: 26px; width: auto; display: block; }
.app-brand-combo { height: 60px; width: auto; display: block; }
/* Co-branding sobrio Eleckai + Kia (dealer oficial) */
.app-brand { gap: 10px; }
.app-brand-kia { display: inline-flex; align-items: center; gap: 7px; padding-left: 10px; border-left: 1px solid var(--el-border); }
.app-brand-kia-mark { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.14em; color: var(--el-text); }
.app-brand-kia-logo { height: 26px; width: auto; display: block; }
.app-brand-kia-txt { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--el-text-muted); line-height: 1.05; max-width: 84px; }
@media (max-width: 560px) { .app-brand-kia-txt { display: none; } }

/* --- Navegación superior (escritorio) --- */
.app-topnav { display: none; align-items: center; gap: var(--el-space-4); }
.app-topnav-link {
    position: relative;
    color: var(--el-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 2px;
    transition: color 0.15s ease;
}
.app-topnav-link:hover { color: var(--el-text); }
.app-topnav-link.is-active { color: var(--el-text); font-weight: 600; }
.app-topnav-link.is-active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
    height: 2px; background: var(--el-text); border-radius: 2px;
}

/* --- Contenido público (deja hueco para el menú inferior en móvil) --- */
.app-public .app-main {
    padding-top: var(--el-space-4);
    padding-bottom: calc(var(--el-bottomnav-h) + var(--el-space-4));
    min-height: 60vh;
}

/* --- Menú inferior (público, solo móvil) --- */
.app-bottomnav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    height: var(--el-bottomnav-h);
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--el-border);
    z-index: 20;
}

.app-bottomnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--el-text-muted);
    text-decoration: none;
    min-width: 56px;
    padding: 6px 4px;
}

.app-bottomnav-item.is-active {
    color: var(--el-text);
    font-weight: 600;
}

.app-bottomnav-icon { display: inline-flex; line-height: 0; }
.app-bottomnav-icon .app-ico { width: 22px; height: 22px; }
.app-bottomnav-label { white-space: nowrap; }

/* --- Panel privado (sidebar + contenido) --- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--el-surface);
    border-right: 1px solid var(--el-border);
    padding: var(--el-space-4) var(--el-space-3);
}

.app-sidebar-brand {
    font-size: 1.25rem;
    margin-bottom: var(--el-space-4);
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-sidebar-item {
    padding: 10px 12px;
    border-radius: var(--el-radius-sm);
    color: var(--el-text-muted);
    text-decoration: none;
}

.app-sidebar-item:hover {
    background: rgba(17, 17, 17, 0.04);
    color: var(--el-text);
}

.app-sidebar-item.is-active {
    background: var(--el-bg);
    color: var(--el-text);
    font-weight: 600;
    box-shadow: var(--el-shadow);
}

.app-content {
    flex: 1;
    min-width: 0;
}

/* --- Cards --- */
.card,
.app-card-vehiculo {
    border: 1px solid var(--el-border);
    border-radius: var(--el-radius);
    background: var(--el-bg);
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.app-card-vehiculo:hover {
    border-color: var(--el-border-strong);
    box-shadow: var(--el-shadow-lg);
    transform: translateY(-3px);
}

.app-card-vehiculo .card-img-top {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--el-surface);
}

/* --- Estados --- */
.app-state-icon { color: var(--el-text-muted); margin-bottom: var(--el-space-2); }
.app-state-icon .app-ico { width: 34px; height: 34px; }

.app-skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f7 37%, #eee 63%);
    background-size: 400% 100%;
    animation: el-shimmer 1.4s ease infinite;
    border-radius: var(--el-radius-sm);
}

.app-skeleton-line {
    height: 14px;
    margin-bottom: var(--el-space-2);
}

.app-skeleton-card {
    height: 160px;
    margin-top: var(--el-space-3);
}

@keyframes el-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* --- Responsive: sidebar colapsa en móvil --- */
@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--el-border);
    }

    .app-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--el-space-2);
    }
}

/* ==========================================================================
   Inicio público (Sprint 1)
   ========================================================================== */

/* Botones de marca */
.btn-eleckai {
    background: var(--el-text);
    color: #fff;
    border-radius: var(--el-radius-sm);
    padding: 11px 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: 1px solid var(--el-text);
    transition: background 0.15s ease, transform 0.12s ease;
}
.btn-eleckai:hover { background: #000; color: #fff; transform: translateY(-1px); }

.btn-eleckai-ghost {
    background: transparent;
    color: var(--el-text);
    border-radius: var(--el-radius-sm);
    padding: 11px 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: 1px solid var(--el-border-strong);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-eleckai-ghost:hover { background: var(--el-surface); color: var(--el-text); border-color: var(--el-text); }

/* Icono lineal */
.app-ico { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }

/* Secciones */
.app-section { margin-top: var(--el-space-5); }
.app-section-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--el-space-3); }
.app-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--el-space-3); }
.app-section-link { color: var(--el-text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.app-section-link:hover { color: var(--el-text); }
.app-section-link .app-ico { width: 16px; height: 16px; }

/* --- Hero rotativo --- */
.app-hero { position: relative; margin-top: var(--el-space-3); }
.app-hero-slide { display: none; }
.app-hero-slide.is-active { display: block; animation: el-fade 0.5s ease; }
@keyframes el-fade { from { opacity: 0; } to { opacity: 1; } }

.app-hero-media {
    border-radius: var(--el-radius);
    overflow: hidden;
    background: var(--el-surface);
    aspect-ratio: 16 / 10;
}
.app-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.app-hero-body { padding-top: var(--el-space-3); }
.app-hero-tag { color: var(--el-text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.app-hero-claim { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin: var(--el-space-2) 0; line-height: 1.15; }
.app-hero-sub { color: var(--el-text-muted); margin-bottom: var(--el-space-2); }
.app-hero-precio { font-size: 0.95rem; margin-bottom: var(--el-space-3); }
.app-hero-cta { display: flex; flex-wrap: wrap; gap: var(--el-space-2); }

.app-hero-dots { display: flex; gap: 6px; justify-content: center; margin-top: var(--el-space-3); }
.app-hero-dot { width: 8px; height: 8px; border-radius: 999px; border: 0; background: var(--el-border); padding: 0; cursor: pointer; }
.app-hero-dot.is-active { background: var(--el-text); width: 22px; }

/* --- Accesos rápidos --- */
.app-accesos { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--el-space-3); }
.app-acceso {
    display: flex; align-items: center; gap: var(--el-space-3);
    padding: var(--el-space-3);
    background: var(--el-bg);
    border: 1px solid var(--el-border);
    border-radius: var(--el-radius);
    box-shadow: var(--el-shadow);
    text-decoration: none; color: var(--el-text);
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.app-acceso:hover { transform: translateY(-2px); border-color: var(--el-text); color: var(--el-text); }
.app-acceso-ico { flex-shrink: 0; display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--el-radius-sm); background: var(--el-surface); }
.app-acceso-txt { display: flex; flex-direction: column; min-width: 0; }
.app-acceso-label { font-weight: 700; font-size: 0.95rem; }
.app-acceso-sub { color: var(--el-text-muted); font-size: 0.8rem; }

/* --- Carrusel horizontal --- */
.app-carousel {
    display: flex; gap: var(--el-space-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--el-space-2);
    scrollbar-width: thin;
}
.app-carousel-item { flex: 0 0 78%; max-width: 260px; scroll-snap-align: start; }

/* --- Ventajas / confianza --- */
.app-ventajas { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--el-space-3); }
.app-ventaja { padding: var(--el-space-3); background: var(--el-surface); border-radius: var(--el-radius); }
.app-ventaja-ico { display: inline-flex; color: var(--el-text); margin-bottom: var(--el-space-2); }
.app-ventaja-titulo { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.app-ventaja-texto { color: var(--el-text-muted); font-size: 0.85rem; margin: 0; }

/* --- Escritorio --- */
@media (min-width: 768px) {
    .app-hero-slide.is-active { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: var(--el-space-5); }
    .app-hero-body { padding-top: 0; }
    .app-hero-claim { font-size: 2.4rem; }
    .app-accesos { grid-template-columns: repeat(4, 1fr); }
    .app-ventajas { grid-template-columns: repeat(4, 1fr); }
    .app-carousel-item { flex-basis: 300px; max-width: 300px; }
}

/* ==========================================================================
   Vehículos — buscador + listado (Sprint 1)
   ========================================================================== */

.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

/* Cabecera de página */
.app-page-head { margin-top: var(--el-space-3); }
.app-page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
.app-page-sub { margin: 0; }

/* Buscador */
.app-search { display: flex; gap: var(--el-space-2); margin-top: var(--el-space-4); }
.app-search-input {
    flex: 1; min-width: 0;
    border: 1px solid var(--el-border);
    border-radius: 999px;
    padding: 11px 18px;
    font-size: 0.95rem;
    background: var(--el-bg);
    color: var(--el-text);
}
.app-search-input:focus { outline: none; border-color: var(--el-text); }

/* Filtros */
.app-filtros { margin-top: var(--el-space-4); display: flex; flex-direction: column; gap: var(--el-space-3); }
.app-filtro-grupo { display: flex; flex-direction: column; gap: 6px; }
.app-filtro-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--el-text-muted); }
.app-chips { display: flex; flex-wrap: wrap; gap: var(--el-space-2); }
.app-chip {
    display: inline-flex; align-items: center;
    padding: 7px 14px;
    border: 1px solid var(--el-border);
    border-radius: 999px;
    background: var(--el-bg);
    color: var(--el-text);
    text-decoration: none;
    font-size: 0.85rem; font-weight: 600;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.app-chip:hover { border-color: var(--el-text); }
.app-chip.is-active { background: var(--el-text); border-color: var(--el-text); color: #fff; }

/* Barra de resultados */
.app-results-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: var(--el-space-4); padding-bottom: var(--el-space-2);
    border-bottom: 1px solid var(--el-border);
}
.app-results-count { font-size: 0.95rem; }
.app-results-clear { color: var(--el-text-muted); font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.app-results-clear:hover { color: var(--el-text); }

/* Grid de resultados */
.app-grid-vehiculos {
    margin-top: var(--el-space-4);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--el-space-3);
}

/* Card: media con badges superpuestos */
.app-card-media { position: relative; }
.app-card-etiqueta, .app-card-flag {
    position: absolute; top: 10px;
    font-size: 0.72rem; font-weight: 700;
    padding: 4px 10px; border-radius: 999px;
}
.app-card-etiqueta { left: 10px; background: var(--el-text); color: #fff; }
.app-card-etiqueta.is-ocasion { background: var(--el-text-muted); }
.app-card-flag { right: 10px; background: var(--el-success); color: #fff; }

.app-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--el-space-2); }
.app-card-cta { display: flex; gap: var(--el-space-2); margin-top: var(--el-space-3); }
.app-card-cta .btn { flex: 1; text-align: center; display: inline-flex; align-items: center; justify-content: center; }

/* Escritorio */
@media (min-width: 576px) {
    .app-grid-vehiculos { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .app-grid-vehiculos { grid-template-columns: repeat(3, 1fr); }
    .app-filtros { flex-flow: row wrap; gap: var(--el-space-4); }
    .app-filtro-grupo { flex: 1 1 auto; }
}

/* ==========================================================================
   Ficha de vehículo (Sprint 1)
   ========================================================================== */

.app-back { display: inline-block; margin-top: var(--el-space-3); color: var(--el-text-muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.app-back:hover { color: var(--el-text); }

.app-ficha { margin-top: var(--el-space-3); }

/* Galería */
.app-galeria-main { position: relative; border-radius: var(--el-radius); overflow: hidden; background: var(--el-surface); aspect-ratio: 16 / 10; }
.app-galeria-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-galeria-thumbs { display: flex; gap: var(--el-space-2); margin-top: var(--el-space-2); overflow-x: auto; }
.app-galeria-thumb {
    flex: 0 0 auto; width: 84px;
    border: 1px solid var(--el-border); border-radius: var(--el-radius-sm);
    background: var(--el-bg); padding: 0; overflow: hidden; cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
}
.app-galeria-thumb img { width: 100%; height: 52px; object-fit: cover; }
.app-galeria-thumb span { font-size: 0.68rem; color: var(--el-text-muted); padding: 3px 0; }
.app-galeria-thumb.is-active { border-color: var(--el-text); }
.app-galeria-thumb.is-active span { color: var(--el-text); font-weight: 600; }

/* Resumen / precio */
.app-ficha-resumen { margin-top: var(--el-space-4); }
.app-ficha-tag { color: var(--el-text-muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.app-ficha-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.app-ficha-version { margin: 0; }

.app-precio-box {
    display: flex; flex-wrap: wrap; gap: var(--el-space-3); justify-content: space-between;
    align-items: flex-end; margin-top: var(--el-space-3);
    padding: var(--el-space-3); background: var(--el-surface); border-radius: var(--el-radius);
}
.app-precio-label { display: block; font-size: 0.8rem; color: var(--el-text-muted); }
.app-precio-valor { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.app-precio-fin { text-align: right; }
.app-precio-cuota { display: block; font-size: 1.15rem; font-weight: 700; }
.app-precio-cuota small { font-weight: 500; color: var(--el-text-muted); }
.app-precio-cond { display: block; font-size: 0.78rem; }

/* CTAs */
.app-ficha-cta { display: flex; flex-wrap: wrap; gap: var(--el-space-2); margin-top: var(--el-space-3); }
.app-ficha-cta .btn { flex: 1 1 auto; }
.app-fin-productos { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.app-fin-productos-label { font-size: 0.78rem; color: var(--el-text-muted); }
.app-fin-productos-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.app-fin-chip { font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border: 1px solid var(--el-border); border-radius: 999px; color: var(--el-text); background: var(--el-surface); }
.app-fav.is-active { background: var(--el-text); color: #fff; border-color: var(--el-text); }
.app-fav.is-active .app-fav-ico { color: #fff; }

.app-sim-confirm {
    margin-top: var(--el-space-3); padding: 12px 16px;
    background: rgba(26, 127, 75, 0.10); border: 1px solid var(--el-success);
    color: var(--el-success); border-radius: var(--el-radius-sm); font-size: 0.9rem; font-weight: 600;
}

/* Especificaciones */
.app-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border: 1px solid var(--el-border); border-radius: var(--el-radius); overflow: hidden; }
.app-spec { display: flex; justify-content: space-between; gap: var(--el-space-2); padding: 12px 16px; border-bottom: 1px solid var(--el-border); }
.app-spec:nth-last-child(-n+2) { border-bottom: 0; }
.app-spec dt { color: var(--el-text-muted); font-size: 0.85rem; margin: 0; }
.app-spec dd { margin: 0; font-weight: 600; font-size: 0.9rem; text-align: right; }

/* Equipamiento */
.app-equip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: var(--el-space-2); }
.app-equip-item { position: relative; padding-left: 26px; color: var(--el-text); }
.app-equip-item::before { content: "✓"; position: absolute; left: 0; color: var(--el-success); font-weight: 700; }

/* Escritorio: galería + resumen en dos columnas */
@media (min-width: 768px) {
    .app-ficha { display: grid; grid-template-columns: 1.1fr 0.9fr; grid-template-rows: auto auto; gap: var(--el-space-4) var(--el-space-5); align-items: start; }
    .app-galeria { grid-column: 1; grid-row: 1; }
    .app-ficha-resumen { grid-column: 2; grid-row: 1; margin-top: 0; }
    .app-ficha .app-section { grid-column: 1 / -1; }
    .app-equip { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Mi Asesor (/asesor)
   ========================================================================== */
.app-asesor { margin-top: var(--el-space-3); }

/* Cabecera */
.app-asesor-head {
    display: flex; gap: var(--el-space-3); align-items: center;
    padding: var(--el-space-4); background: var(--el-surface); border-radius: var(--el-radius);
}
.app-asesor-avatar { position: relative; flex: 0 0 auto; }
.app-asesor-avatar img {
    width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
    background: var(--el-bg); border: 3px solid var(--el-bg); box-shadow: var(--el-shadow);
}
.app-asesor-dot {
    position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px;
    border-radius: 50%; border: 3px solid var(--el-surface); background: var(--el-text-muted);
}
.app-asesor-dot.is-online { background: var(--el-success); }
.app-asesor-dot.is-away   { background: #e0a400; }
.app-asesor-dot.is-busy   { background: var(--el-error); }
.app-asesor-rol { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--el-text-muted); }
.app-asesor-nombre { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0; }
.app-asesor-cargo { margin: 0; font-size: 0.92rem; }
.app-asesor-sede { margin: 2px 0 8px; font-size: 0.85rem; color: var(--el-text); }
.app-asesor-estado {
    display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700;
    padding: 4px 12px; border-radius: 999px; background: var(--el-bg); border: 1px solid var(--el-border);
}
.app-asesor-estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--el-text-muted); }
.app-asesor-estado.is-online { color: var(--el-success); } .app-asesor-estado.is-online::before { background: var(--el-success); }
.app-asesor-estado.is-away   { color: #a67a00; } .app-asesor-estado.is-away::before { background: #e0a400; }
.app-asesor-estado.is-busy   { color: var(--el-error); } .app-asesor-estado.is-busy::before { background: var(--el-error); }

/* Acciones rápidas */
.app-asesor-acciones { display: flex; gap: var(--el-space-2); margin-top: var(--el-space-3); }
.app-accion {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 14px 8px; text-decoration: none; color: var(--el-text); font-weight: 600; font-size: 0.85rem;
    background: var(--el-bg); border: 1px solid var(--el-border); border-radius: var(--el-radius);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.app-accion:hover { background: var(--el-surface); }
.app-accion-ico { font-size: 1.3rem; }
.app-accion.is-chat:hover { border-color: var(--el-border-strong); }

/* Horario */
.app-horario-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--el-border); border-radius: var(--el-radius); overflow: hidden; }
.app-horario-row { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--el-border); }
.app-horario-row:last-child { border-bottom: 0; }
.app-horario-dia { color: var(--el-text-muted); font-size: 0.9rem; }
.app-horario-horas { font-weight: 600; font-size: 0.9rem; }

/* Chat */
.app-chat {
    display: flex; flex-direction: column; gap: var(--el-space-2);
    padding: var(--el-space-3); background: var(--el-surface); border-radius: var(--el-radius);
    max-height: 60vh; overflow-y: auto;
}
.app-chat-fecha { text-align: center; margin: 6px 0; }
.app-chat-fecha span { font-size: 0.72rem; color: var(--el-text-muted); background: var(--el-bg); padding: 3px 10px; border-radius: 999px; }
.app-msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; position: relative; }
.app-msg-texto { margin: 0; font-size: 0.92rem; line-height: 1.35; }
.app-msg-hora { display: block; text-align: right; font-size: 0.66rem; color: var(--el-text-muted); margin-top: 3px; }
.app-msg-asesor { align-self: flex-start; background: var(--el-bg); border: 1px solid var(--el-border); border-bottom-left-radius: 4px; }
.app-msg-cliente { align-self: flex-end; background: var(--el-text); color: #fff; border-bottom-right-radius: 4px; }
.app-msg-cliente .app-msg-hora { color: rgba(255, 255, 255, 0.7); }

/* Respuestas rápidas */
.app-chat-quick { display: flex; flex-wrap: wrap; gap: var(--el-space-2); margin-top: var(--el-space-3); }
.app-quick-chip {
    border: 1px solid var(--el-border); background: var(--el-bg); color: var(--el-text);
    padding: 7px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.app-quick-chip:hover { background: var(--el-surface); border-color: var(--el-text); }

/* Caja de mensaje */
.app-chat-form { display: flex; gap: var(--el-space-2); margin-top: var(--el-space-3); }
.app-chat-input {
    flex: 1 1 auto; border: 1px solid var(--el-border); border-radius: 999px;
    padding: 11px 18px; font-size: 0.95rem; background: var(--el-bg); color: var(--el-text);
}
.app-chat-input:focus { outline: none; border-color: var(--el-text); }
.app-chat-send {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--el-text); color: #fff; cursor: pointer;
}
.app-chat-send:hover { background: #000; }
.app-chat-nota { font-size: 0.75rem; margin: 8px 2px 0; }

/* CTAs */
.app-asesor-cta { display: flex; flex-direction: column; gap: var(--el-space-2); }
.app-asesor-cta .btn { width: 100%; }

@media (min-width: 768px) {
    .app-asesor-cta { flex-direction: row; }
    .app-asesor-cta .btn { flex: 1 1 0; }
    .app-msg { max-width: 62%; }
}

/* ==========================================================================
   Taller (/taller)
   ========================================================================== */
.app-taller { margin-top: var(--el-space-3); }

/* Cabecera — banda premium oscura */
.app-taller-hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: var(--el-space-5) var(--el-space-4);
    margin-top: var(--el-space-3);
    border-radius: var(--el-radius);
    color: #fff;
    background:
        radial-gradient(120% 120% at 80% 0%, rgba(255, 255, 255, 0.10), transparent 55%),
        linear-gradient(160deg, #1a1a1e 0%, #0a0a0a 100%);
    border: 1px solid #000;
    box-shadow: var(--el-shadow-lg);
}
.app-taller-hero-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}
.app-taller-hero::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(160deg, rgba(10, 10, 12, 0.72) 0%, rgba(10, 10, 12, 0.9) 100%);
}
.app-taller-hero-inner { position: relative; z-index: 2; max-width: 40rem; margin: 0 auto; }
.app-taller-eyebrow {
    display: inline-block; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.09em; text-transform: uppercase; color: rgba(255, 255, 255, 0.66);
    margin-bottom: 10px;
}
.app-taller-title { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 10px; }
.app-taller-sub { color: rgba(255, 255, 255, 0.78); margin: 0 auto var(--el-space-3); max-width: 40ch; }
.app-taller-hero-meta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: var(--el-space-2); margin-bottom: var(--el-space-4);
}
.app-taller-hero-meta .app-asesor-estado { background: rgba(255, 255, 255, 0.12); color: #fff; }
.app-taller-hero-detalle { font-size: 0.82rem; color: rgba(255, 255, 255, 0.6); }
.app-taller-cita { width: 100%; max-width: 320px; background: #fff; color: #0a0a0a; border-color: #fff; }
.app-taller-cita:hover { background: rgba(255, 255, 255, 0.9); }

/* Estado de mi vehículo */
.app-vestado { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--el-space-2); }
.app-vestado-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: var(--el-space-3);
    background: var(--el-bg); border: 1px solid var(--el-border); border-radius: var(--el-radius);
}
.app-vestado-ico {
    display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center;
    border-radius: 10px; background: var(--el-surface); border: 1px solid var(--el-border); margin-bottom: 4px;
}
.app-vestado-ico .app-ico { width: 20px; height: 20px; }
.app-vestado-card.is-ok .app-vestado-ico { color: var(--el-success); border-color: rgba(26, 127, 75, 0.25); background: rgba(26, 127, 75, 0.07); }
.app-vestado-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.app-vestado-valor { font-weight: 700; letter-spacing: -0.01em; }

/* Línea con icono dentro de la cita */
.app-cita-linea { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; }
.app-cita-linea .app-ico { width: 15px; height: 15px; }

/* Confianza */
.app-confianza { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--el-space-2); }
.app-confianza-card {
    padding: var(--el-space-3);
    background: var(--el-bg); border: 1px solid var(--el-border); border-radius: var(--el-radius);
}
.app-confianza-ico {
    display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
    border-radius: 10px; background: var(--el-surface); border: 1px solid var(--el-border);
}
.app-confianza-ico .app-ico { width: 22px; height: 22px; }
.app-confianza-titulo { font-size: 0.98rem; font-weight: 700; margin: 10px 0 4px; letter-spacing: -0.01em; }
.app-confianza-texto { font-size: 0.83rem; margin: 0; }


/* Próxima cita */
.app-cita-card {
    display: flex; align-items: center; gap: var(--el-space-3);
    padding: var(--el-space-3); border: 1px solid var(--el-border); border-radius: var(--el-radius);
}
.app-cita-fecha {
    flex: 0 0 auto; text-align: center; padding: 10px 14px; border-radius: var(--el-radius-sm);
    background: var(--el-text); color: #fff; min-width: 96px;
}
.app-cita-dia { display: block; font-size: 0.72rem; opacity: 0.85; }
.app-cita-hora { display: block; font-size: 1.25rem; font-weight: 800; }
.app-cita-info { flex: 1 1 auto; display: flex; flex-direction: column; }
.app-cita-servicio { font-weight: 700; }
.app-cita-veh { font-size: 0.85rem; }
.app-cita-estado {
    flex: 0 0 auto; font-size: 0.75rem; font-weight: 700; color: var(--el-success);
    background: rgba(26, 127, 75, 0.10); padding: 4px 10px; border-radius: 999px;
}

/* Servicios */
.app-servicios { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--el-space-2); }
.app-servicio {
    padding: var(--el-space-3); border: 1px solid var(--el-border); border-radius: var(--el-radius);
    background: var(--el-bg);
}
.app-servicio-ico { font-size: 1.5rem; }
.app-servicio-nombre { font-size: 1rem; font-weight: 700; margin: 6px 0 4px; }
.app-servicio-desc { font-size: 0.82rem; margin: 0; }

/* Timeline / historial */
.app-timeline { list-style: none; margin: 0; padding: 0; }
.app-timeline-item { position: relative; padding: 0 0 var(--el-space-4) var(--el-space-4); }
.app-timeline-item::before {
    content: ""; position: absolute; left: 6px; top: 14px; bottom: -4px; width: 2px; background: var(--el-border);
}
.app-timeline-item:last-child::before { display: none; }
.app-timeline-dot {
    position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--el-text-muted); border: 3px solid var(--el-bg); box-shadow: 0 0 0 1px var(--el-border);
}
.app-timeline-dot.is-done { background: var(--el-success); }
.app-timeline-dot.is-progress { background: #e0a400; }
.app-timeline-dot.is-wait { background: var(--el-error); }
.app-timeline-body {
    border: 1px solid var(--el-border); border-radius: var(--el-radius); padding: var(--el-space-3);
    background: var(--el-bg);
}
.app-timeline-top { display: flex; justify-content: space-between; gap: var(--el-space-2); align-items: baseline; }
.app-timeline-servicio { font-weight: 700; }
.app-timeline-fecha { font-size: 0.8rem; }
.app-timeline-veh { display: block; font-size: 0.82rem; margin-top: 2px; }
.app-timeline-detalle { margin: 8px 0; font-size: 0.9rem; }
.app-timeline-meta { display: flex; justify-content: space-between; align-items: center; }
.app-timeline-estado { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--el-surface); }
.app-timeline-estado.is-done { color: var(--el-success); }
.app-timeline-estado.is-progress { color: #a67a00; }
.app-timeline-estado.is-wait { color: var(--el-error); }
.app-timeline-importe { font-weight: 700; font-size: 0.9rem; }

/* CTAs */
.app-taller-cta { display: flex; flex-direction: column; gap: var(--el-space-2); flex-wrap: wrap; }
.app-taller-cta .btn { width: 100%; }

@media (min-width: 768px) {
    .app-servicios { grid-template-columns: repeat(4, 1fr); }
    .app-vestado { grid-template-columns: repeat(4, 1fr); }
    .app-confianza { grid-template-columns: repeat(4, 1fr); }
    .app-taller-cta { flex-direction: row; }
    .app-taller-cta .btn { flex: 1 1 0; }
    .app-taller-title { font-size: 2.1rem; }
}

/* ==========================================================================
   Refactor visual premium — navegación responsive, footer y remates
   ========================================================================== */

/* Favorito: corazón relleno al activar */
.app-fav.is-active .app-ico { fill: #fff; }

/* Acceso rápido: icono con trazo fino */
.app-acceso-ico .app-ico { width: 22px; height: 22px; color: var(--el-text); }
.app-ventaja-ico .app-ico { width: 26px; height: 26px; }
.app-accion-ico .app-ico { width: 22px; height: 22px; }
.app-servicio-ico .app-ico { width: 26px; height: 26px; color: var(--el-text); }
.app-chat-send .app-ico { width: 20px; height: 20px; }
.app-back .app-ico { width: 18px; height: 18px; }

/* Footer sobrio (banda oscura) */
.app-footer {
    margin-top: var(--el-space-5);
    background: #0a0a0a;
    color: rgba(255, 255, 255, 0.7);
    padding: var(--el-space-5) 0 calc(var(--el-bottomnav-h) + var(--el-space-4));
}
.app-footer-inner { display: flex; flex-direction: column; align-items: flex-start; gap: var(--el-space-3); }
.app-footer-logo { height: 30px; width: auto; opacity: 0.95; }
.app-footer-tag { margin: 0; font-size: 0.9rem; color: rgba(255, 255, 255, 0.6); }
.app-footer-links { display: flex; flex-wrap: wrap; gap: var(--el-space-4); }
.app-footer-links a { color: rgba(255, 255, 255, 0.8); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.app-footer-links a:hover { color: #fff; }
.app-footer-legal { margin: 0; font-size: 0.78rem; color: rgba(255, 255, 255, 0.4); }

/* Escritorio: navegación superior visible, menú inferior oculto */
@media (min-width: 768px) {
    .app-topnav { display: flex; }
    .app-bottomnav { display: none; }
    .app-public .app-main { padding-bottom: var(--el-space-5); }
    .app-brand-logo { height: 30px; }
    .app-footer { padding-bottom: var(--el-space-5); }
    .app-footer-inner { flex-direction: row; align-items: center; }
    .app-footer-tag { margin-right: auto; }
}

/* Contenedor público: ancho contenido y respiración amplia */
@media (min-width: 1200px) {
    .app-public .app-main.container,
    .app-topbar-inner.container,
    .app-footer-inner.container { max-width: 1140px; }
}

/* ============================================================= *
 *  MÁS · Centro de servicios del concesionario                  *
 * ============================================================= */
.app-page-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--el-text-muted);
    margin-bottom: 6px;
}

/* --- Mi espacio (índice tipo Ajustes) --- */
.app-mas { padding-bottom: var(--el-space-4); }

.app-mas-cuenta {
    display: flex;
    align-items: center;
    gap: var(--el-space-3);
    padding: var(--el-space-4);
    margin-bottom: var(--el-space-5);
    border-radius: 20px;
    background: linear-gradient(135deg, #101012 0%, #26262b 100%);
    color: #fff;
    box-shadow: var(--el-shadow-lg);
}
.app-mas-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}
.app-mas-cuenta-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-mas-cuenta-hola { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.app-mas-cuenta-sub { color: rgba(255, 255, 255, 0.62) !important; font-size: 0.9rem; }
.app-mas-cuenta-chip {
    align-self: flex-start;
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.app-mas-bloque { margin-bottom: var(--el-space-5); }
.app-mas-bloque-head {
    display: flex;
    align-items: center;
    gap: var(--el-space-3);
    margin-bottom: var(--el-space-3);
    padding: 0 2px;
}
.app-mas-bloque-ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--el-accent);
    color: #fff;
}
.app-mas-bloque-ico .app-ico { width: 21px; height: 21px; }
.app-mas-bloque-titulos { min-width: 0; }
.app-mas-bloque-titulo { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.app-mas-bloque-sub { margin: 1px 0 0; font-size: 0.88rem; }

.app-mas-lista {
    border: 1px solid var(--el-border);
    border-radius: var(--el-radius);
    background: var(--el-bg);
    overflow: hidden;
    box-shadow: var(--el-shadow);
}
.app-mas-fila {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--el-space-3);
    padding: 14px var(--el-space-3);
    text-decoration: none;
    color: var(--el-text);
    border-top: 1px solid var(--el-border);
    transition: background-color 0.14s ease;
}
.app-mas-fila:first-child { border-top: 0; }
.app-mas-fila:hover { background: var(--el-surface); }
.app-mas-fila-ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--el-surface);
    border: 1px solid var(--el-border);
    color: var(--el-text);
}
.app-mas-fila:hover .app-mas-fila-ico { background: var(--el-bg); border-color: var(--el-border-strong); }
.app-mas-fila-ico .app-ico { width: 20px; height: 20px; }
.app-mas-fila-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.app-mas-fila-titulo { font-weight: 600; letter-spacing: -0.01em; }
.app-mas-fila-sub { font-size: 0.83rem; }
.app-mas-fila-soon {
    flex: 0 0 auto;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--el-text-muted);
    background: var(--el-surface-2);
    border-radius: 999px;
    padding: 3px 9px;
}
.app-mas-fila-arrow { flex: 0 0 auto; color: var(--el-text-muted); display: inline-flex; transition: transform 0.14s ease; }
.app-mas-fila-arrow .app-ico { width: 18px; height: 18px; transform: scaleX(-1); }
.app-mas-fila:hover .app-mas-fila-arrow { color: var(--el-text); transform: translateX(2px); }

.app-mas-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--el-space-3);
    padding: var(--el-space-4);
    border: 1px solid var(--el-border);
    border-radius: var(--el-radius);
    background: var(--el-surface);
    margin-top: var(--el-space-5);
}
.app-mas-pie-txt { display: flex; flex-direction: column; gap: 2px; }
.app-mas-pie-titulo { font-weight: 700; letter-spacing: -0.01em; }
.app-mas-pie-sub { font-size: 0.88rem; }
.app-mas-version { text-align: center; font-size: 0.78rem; margin-top: var(--el-space-4); }

/* --- Ficha de servicio --- */
.app-mas-hero {
    text-align: center;
    padding: var(--el-space-5) var(--el-space-3) var(--el-space-4);
}
.app-mas-hero-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--el-surface);
    border: 1px solid var(--el-border);
    margin-bottom: var(--el-space-3);
}
.app-mas-hero-ico .app-ico { width: 30px; height: 30px; }
.app-mas-hero-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.app-mas-hero-sub { margin: 0 auto; max-width: 34rem; }

.app-mas-badge {
    display: inline-block;
    margin-top: var(--el-space-3);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--el-text-muted);
    background: var(--el-surface-2);
    border: 1px solid var(--el-border);
    border-radius: 999px;
    padding: 5px 12px;
}

.app-mas-texto { font-size: 1.02rem; line-height: 1.6; max-width: 42rem; }

.app-mas-datos {
    margin: var(--el-space-4) 0 0;
    border: 1px solid var(--el-border);
    border-radius: var(--el-radius);
    overflow: hidden;
}
.app-mas-dato {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--el-space-3);
    border-bottom: 1px solid var(--el-border);
}
.app-mas-dato:last-child { border-bottom: 0; }
.app-mas-dato dt { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--el-text-muted); }
.app-mas-dato dd { margin: 0; font-weight: 500; }

.app-mas-nota { margin-top: var(--el-space-4); font-size: 0.9rem; }

.app-mas-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--el-space-2);
    margin-top: var(--el-space-4);
}

@media (min-width: 768px) {
    .app-mas-hero { padding-top: var(--el-space-5); }
}
@media (min-width: 900px) {
    .app-mas { max-width: 720px; margin-inline: auto; }
}

/* ==========================================================================
   BackOffice — panel privado (sidebar oscuro + sistema de UI)
   ========================================================================== */
.bo-body { background: var(--el-surface); color: var(--el-text); }
.bo-shell { display: flex; min-height: 100vh; }

/* --- Sidebar oscuro --- */
.bo-sidebar {
    width: 252px; flex-shrink: 0;
    background: #0b0b0d; color: #b9b9c0;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    border-right: 1px solid #17171b;
}
.bo-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; text-decoration: none; }
.bo-brand-combo { height: 66px; width: auto; display: block; background: #fff; border-radius: 12px; padding: 8px 12px; }
.bo-brand-mark { width: 32px; height: 32px; border-radius: 9px; background: #fff; color: #0b0b0d; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; }
.bo-brand-text { color: #fff; font-size: 1.16rem; letter-spacing: -0.02em; line-height: 1; }
.bo-brand-kia { display: inline-block; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em; vertical-align: middle; margin-left: 4px; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,0.12); color: #fff; }
.bo-brand-sub { display: block; font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: #6a6a73; margin-top: 3px; }
.bo-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; overflow-y: auto; flex: 1; }
.bo-nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #b0b0b8; text-decoration: none; font-size: 0.92rem; transition: background 0.15s ease, color 0.15s ease; }
.bo-nav-item:hover { background: #17171b; color: #fff; }
.bo-nav-item.is-active { background: #fff; color: #0b0b0d; font-weight: 600; }
.bo-nav-item .app-ico { width: 19px; height: 19px; flex-shrink: 0; }
.bo-sidebar-foot { padding: 14px 16px; border-top: 1px solid #17171b; }
.bo-user { display: flex; align-items: center; gap: 10px; }
.bo-avatar { width: 34px; height: 34px; border-radius: 50%; background: #2a2a30; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 0.78rem; flex-shrink: 0; }
.bo-user-name { color: #fff; font-size: 0.85rem; display: block; line-height: 1.2; }
.bo-user-role { color: #6a6a73; font-size: 0.72rem; display: block; }

/* --- Área principal --- */
.bo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* --- Topbar --- */
.bo-topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--el-border); display: flex; align-items: center; gap: 16px; padding: 12px 24px; }
.bo-topbar-title { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.bo-search { position: relative; flex: 1; max-width: 440px; margin: 0; }
.bo-search .app-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--el-text-muted); }
.bo-search input { width: 100%; border: 1px solid var(--el-border); border-radius: 999px; padding: 9px 16px 9px 38px; background: var(--el-surface); font-size: 0.9rem; }
.bo-search input:focus { outline: none; border-color: var(--el-border-strong); background: #fff; }
.bo-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bo-iconbtn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--el-border); background: #fff; display: grid; place-items: center; color: var(--el-text); cursor: pointer; }
.bo-iconbtn:hover { background: var(--el-surface); }
.bo-iconbtn .app-ico { width: 19px; height: 19px; }
.bo-badge-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--el-error); border: 1.5px solid #fff; }
.bo-profile { display: flex; align-items: center; gap: 9px; padding: 3px 12px 3px 3px; border: 1px solid var(--el-border); border-radius: 999px; }
.bo-profile .bo-avatar { width: 30px; height: 30px; background: var(--el-text); }
.bo-profile .bo-user-name { color: var(--el-text); }

/* --- Contenido --- */
.bo-content { padding: 24px; }
.bo-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bo-page-title { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0; }
.bo-page-sub { color: var(--el-text-muted); margin: 4px 0 0; font-size: 0.92rem; }
.bo-page-actions { display: flex; gap: 8px; }

/* --- Cards --- */
.bo-card { background: #fff; border: 1px solid var(--el-border); border-radius: var(--el-radius); box-shadow: var(--el-shadow); }
.bo-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--el-border); }
.bo-card-title { font-weight: 600; font-size: 0.98rem; margin: 0; }
.bo-card-body { padding: 18px; }
.bo-kpi-label { color: var(--el-text-muted); font-size: 0.8rem; }
.bo-kpi-value { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }

/* --- Tablas --- */
.bo-table { width: 100%; border-collapse: collapse; }
.bo-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--el-text-muted); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--el-border); }
.bo-table td { padding: 13px 16px; border-bottom: 1px solid var(--el-border); font-size: 0.9rem; vertical-align: middle; }
.bo-table tbody tr:last-child td { border-bottom: 0; }
.bo-table tbody tr { cursor: pointer; transition: background 0.12s ease; }
.bo-table tbody tr:hover { background: var(--el-surface); }

/* --- Badges de estado --- */
.bo-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.bo-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bo-badge.is-nuevo      { color: #1d4ed8; background: #eef3ff; }
.bo-badge.is-contactado { color: #b45309; background: #fdf5e6; }
.bo-badge.is-agendado   { color: #6d28d9; background: #f4effe; }
.bo-badge.is-ganado     { color: var(--el-success); background: #e9f6ef; }
.bo-badge.is-perdido    { color: var(--el-error); background: #fbece9; }
.bo-badge.is-neutro     { color: var(--el-text-muted); background: var(--el-surface-2); }

/* --- Botones --- */
.bo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; background: var(--el-text); color: #fff; font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none; transition: background 0.15s ease, border-color 0.15s ease; }
.bo-btn:hover { background: #000; color: #fff; }
.bo-btn-ghost { background: #fff; color: var(--el-text); border-color: var(--el-border-strong); }
.bo-btn-ghost:hover { background: var(--el-surface); color: var(--el-text); }
.bo-btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 8px; }
.bo-btn-block { width: 100%; }
.bo-btn .app-ico { width: 17px; height: 17px; }

/* --- Utilidades de rejilla --- */
.bo-grid { display: grid; gap: 16px; }
.bo-grid-2 { grid-template-columns: repeat(2, 1fr); }
.bo-grid-3 { grid-template-columns: repeat(3, 1fr); }
.bo-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .bo-sidebar { width: 72px; }
    .bo-brand { justify-content: center; padding: 20px 0 14px; }
    .bo-brand > span, .bo-nav-item span, .bo-user > span { display: none; }
    .bo-brand-combo { height: 48px; padding: 5px 6px; }
    .bo-nav-item { justify-content: center; }
    .bo-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .bo-search { display: none; }
    .bo-content { padding: 16px; }
    .bo-grid-2, .bo-grid-3, .bo-grid-4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CRM — bandeja + conversación + detalle (3 paneles)
   ========================================================================== */
.crm-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.crm-metric { background: #fff; border: 1px solid var(--el-border); border-radius: var(--el-radius); box-shadow: var(--el-shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }

.crm-layout { display: block; }

/* --- Bandeja --- */
.crm-inbox { display: flex; flex-direction: column; }
.crm-inbox-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--el-border); }
.crm-filters { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--el-border); overflow-x: auto; }
.crm-filter { border: 1px solid var(--el-border); background: #fff; color: var(--el-text-muted); border-radius: 999px; padding: 5px 12px; font-size: 0.78rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.crm-filter:hover { border-color: var(--el-border-strong); color: var(--el-text); }
.crm-filter.is-active { background: var(--el-text); color: #fff; border-color: var(--el-text); }
.crm-leadlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 14px 16px; }

.crm-lead { display: flex; gap: 12px; padding: 13px 14px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); text-decoration: none; color: var(--el-text); transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease; }
.crm-lead:hover { border-color: var(--el-border-strong); box-shadow: var(--el-shadow); transform: translateY(-1px); }
.crm-lead-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--el-text); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 0.9rem; }
.crm-lead-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.crm-lead-top { display: flex; justify-content: space-between; gap: 8px; }
.crm-lead-name { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-lead-when { color: var(--el-text-muted); font-size: 0.72rem; white-space: nowrap; flex-shrink: 0; }
.crm-lead-veh { font-size: 0.78rem; color: var(--el-text-muted); }
.crm-lead-msg { font-size: 0.82rem; color: var(--el-text); opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-lead-foot { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.crm-unread { background: var(--el-error); color: #fff; font-size: 0.68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 5px; }
.crm-empty { text-align: center; padding: 36px 16px; }

/* --- Conversación --- */
.crm-conv { display: flex; flex-direction: column; overflow: hidden; }
.crm-conv-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--el-border); }
.crm-conv-who { display: flex; align-items: center; gap: 12px; }
.crm-conv-name { font-weight: 600; display: block; line-height: 1.2; }
.crm-conv-sub { color: var(--el-text-muted); font-size: 0.78rem; display: block; }
.crm-conv-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--el-surface); }
.crm-msg { max-width: 76%; padding: 10px 14px; border-radius: 14px; box-shadow: var(--el-shadow); }
.crm-msg-texto { margin: 0; font-size: 0.9rem; line-height: 1.4; }
.crm-msg-hora { display: block; margin-top: 4px; font-size: 0.68rem; opacity: 0.6; }
.crm-msg-cliente { align-self: flex-start; background: #fff; border: 1px solid var(--el-border); border-bottom-left-radius: 4px; }
.crm-msg-asesor { align-self: flex-end; background: var(--el-text); color: #fff; border-bottom-right-radius: 4px; }
/* Nota interna dentro del hilo: visible solo para el equipo, no para el cliente */
.crm-msg-nota { align-self: stretch; max-width: 100%; background: #fffbeb; border: 1px solid #fde8b0; border-left: 3px solid #e0a800; box-shadow: none; }
.crm-msg-nota .crm-nota-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #8a6d00; margin-bottom: 4px; }
.crm-msg-nota .crm-nota-flag .app-ico { width: 12px; height: 12px; }
.crm-msg-nota .crm-msg-texto { color: #5c4a00; }
.crm-msg-nota .crm-msg-hora { color: #8a6d00; opacity: 0.75; }
.crm-compose { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--el-border); }
.crm-compose-input { flex: 1; border: 1px solid var(--el-border); border-radius: 999px; padding: 10px 16px; font-size: 0.9rem; }
.crm-compose-input:focus { outline: none; border-color: var(--el-border-strong); }
.crm-conv-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px; }
.crm-conv-head-right { display: inline-flex; align-items: center; gap: 12px; }

/* --- Detalle (contenido del modal de ficha) --- */
.crm-detail { display: flex; flex-direction: column; gap: 16px; }
.crm-actions { display: flex; flex-direction: column; gap: 12px; }

/* --- Modal del lead (conversación + ficha en dos columnas) --- */
.bo-modal[data-crm-modal] .bo-modal-dialog { max-width: 940px; width: 94vw; }
.crm-modal-title { flex-wrap: wrap; }
.crm-modal-title .crm-lead-avatar { width: 36px; height: 36px; font-size: 0.82rem; }
.crm-modal-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.crm-modal-conv { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.crm-modal-conv .crm-conv-body { height: 360px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); }
.crm-modal-conv .crm-compose { border: 1px solid var(--el-border); border-radius: 999px; padding: 7px 8px 7px 4px; }
.crm-modal-ficha .bo-card { box-shadow: none; }
.crm-field { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; color: var(--el-text-muted); font-weight: 600; }
.crm-select { border: 1px solid var(--el-border); border-radius: 10px; padding: 9px 12px; font-size: 0.88rem; color: var(--el-text); background: #fff; font-weight: 500; }
.crm-select:focus { outline: none; border-color: var(--el-border-strong); }
.crm-cliente, .crm-veh { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.crm-veh-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--el-surface-2); display: grid; place-items: center; }
.crm-veh-ico .app-ico { width: 22px; height: 22px; }
.crm-datalist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.crm-datalist li { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--el-text); }
.crm-datalist li span { color: var(--el-text-muted); display: inline-flex; }
.crm-datalist .app-ico { width: 16px; height: 16px; }
.crm-veh-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crm-veh-precio { font-weight: 600; font-size: 1.05rem; }

/* Timeline */
.crm-timeline { list-style: none; margin: 0; padding: 0; }
.crm-tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.crm-tl-item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: 0; width: 1px; background: var(--el-border); }
.crm-tl-ico { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--el-surface-2); display: grid; place-items: center; }
.crm-tl-ico .app-ico { width: 16px; height: 16px; }
.crm-tl-body { display: flex; flex-direction: column; gap: 1px; }
.crm-tl-titulo { font-weight: 600; font-size: 0.86rem; }
.crm-tl-detalle { font-size: 0.8rem; color: var(--el-text-muted); }
.crm-tl-cuando { font-size: 0.72rem; color: var(--el-text-muted); opacity: 0.8; margin-top: 2px; }

/* Notas */
.crm-notas { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.crm-nota { background: var(--el-surface); border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); padding: 10px 12px; }
.crm-nota-texto { margin: 0; font-size: 0.85rem; }
.crm-nota-meta { font-size: 0.72rem; color: var(--el-text-muted); }
.crm-nota-form { display: flex; gap: 8px; }

/* Etiquetas de la conversación (tags) */
.crm-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.crm-tags-label { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 600; color: var(--el-text-muted); }
.crm-tags-label .app-ico { width: 14px; height: 14px; }
.crm-tags-list { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.crm-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; line-height: 1.4; }
.crm-lead-foot .crm-tag { padding: 2px 8px; }
.crm-tag-x { display: inline-flex; border: 0; background: transparent; padding: 0; cursor: pointer; color: currentColor; opacity: 0.55; }
.crm-tag-x:hover { opacity: 1; }
.crm-tag-x .app-ico { width: 12px; height: 12px; }
.crm-tag.is-en-curso   { color: #1d4ed8; background: #eef3ff; }
.crm-tag.is-revisar    { color: #b45309; background: #fdf5e6; }
.crm-tag.is-insistir   { color: var(--el-error); background: #fbece9; }
.crm-tag.is-finalizado { color: var(--el-success); background: #e9f6ef; }
.crm-tag.is-prioridad  { color: #6d28d9; background: #f4effe; }
.crm-tag-add { position: relative; }
.crm-tag-add summary { list-style: none; }
.crm-tag-add summary::-webkit-details-marker { display: none; }
.crm-tag-addbtn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px dashed var(--el-border-strong); border-radius: 999px; font-size: 0.72rem; font-weight: 600; color: var(--el-text-muted); cursor: pointer; background: #fff; }
.crm-tag-addbtn:hover { color: var(--el-text); border-color: var(--el-text); }
.crm-tag-addbtn .app-ico { width: 12px; height: 12px; }
.crm-tag-menu { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; min-width: 160px; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: #fff; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); box-shadow: var(--el-shadow-lg); }
.crm-tag-opt { text-align: left; border: 0; padding: 6px 10px; border-radius: 8px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.crm-tag-opt:hover { filter: brightness(0.96); }

/* Conmutador Mensaje al cliente / Nota interna */
.crm-compose-modes { display: flex; gap: 6px; }
.crm-mode { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--el-border); border-radius: 999px; background: #fff; font-size: 0.76rem; font-weight: 600; color: var(--el-text-muted); cursor: pointer; }
.crm-mode .app-ico { width: 13px; height: 13px; }
.crm-mode:hover { color: var(--el-text); }
.crm-mode.is-active { color: var(--el-text); border-color: var(--el-text); background: var(--el-surface-2); }
.crm-mode[data-crm-mode="nota"].is-active { color: #8a6d00; border-color: #e0a800; background: #fffbeb; }
.crm-compose.is-nota .crm-compose-input:focus { border-color: #e0a800; }

/* Toast simulado */
.crm-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--el-text); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 0.88rem; font-weight: 500; box-shadow: var(--el-shadow-lg); z-index: 60; }

@media (max-width: 768px) {
    .crm-metrics { grid-template-columns: repeat(2, 1fr); }
    .crm-leadlist { grid-template-columns: 1fr; }
    .crm-modal-grid { grid-template-columns: 1fr; }
    .crm-modal-conv { position: static; }
    .crm-modal-conv .crm-conv-body { height: 300px; }
}

/* ===================== Modal genérico BackOffice ===================== */
.bo-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: var(--el-space-3); }
.bo-modal[hidden] { display: none; }
.bo-modal-overlay { position: absolute; inset: 0; background: rgba(10, 10, 12, .55); backdrop-filter: blur(2px); }
.bo-modal-dialog { position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.bo-modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--el-space-3); border-bottom: 1px solid var(--el-border); position: sticky; top: 0; background: var(--el-bg); }
.bo-modal-title { display: inline-flex; align-items: center; gap: 9px; font-size: 1rem; font-weight: 600; margin: 0; color: var(--el-text); }
.bo-modal-title .app-ico { width: 18px; height: 18px; }
.bo-modal-x { border: none; background: transparent; color: var(--el-text-muted); cursor: pointer; display: inline-flex; padding: 4px; border-radius: 8px; transition: background .15s, color .15s; }
.bo-modal-x:hover { background: var(--el-surface); color: var(--el-text); }
.bo-modal-x .app-ico { width: 20px; height: 20px; }
.bo-modal-body { padding: var(--el-space-3); overflow-y: auto; }

/* ============================================================= *
 *  BackOffice · Dashboard (Sprint 2)                            *
 *  Centro de trabajo diario. Zona operativa + zona resumen.     *
 * ============================================================= */

.dash { display: flex; flex-direction: column; gap: var(--el-space-3); }

/* --- Hero de bienvenida --- */
.dash-hero {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--el-space-3);
    padding: var(--el-space-3) var(--el-space-4);
    border-radius: var(--el-radius);
    background: linear-gradient(135deg, #0b0b0d 0%, #1c1c22 100%);
    color: #fff;
}
.dash-hero-eyebrow {
    display: inline-block; font-size: .72rem; letter-spacing: .12em;
    text-transform: uppercase; color: rgba(255, 255, 255, .55);
    margin-bottom: 6px;
}
.dash-hero-title { font-size: 1.5rem; font-weight: 600; margin: 0; color: #fff; }
.dash-hero-sub { margin: 6px 0 0; color: rgba(255, 255, 255, .72); font-size: .92rem; }
.dash-hero-date { text-align: right; line-height: 1.1; }
.dash-hero-hora { display: block; font-size: 1.7rem; font-weight: 600; }
.dash-hero-fecha { display: block; font-size: .82rem; color: rgba(255, 255, 255, .6); margin-top: 4px; }

/* --- Fila de stats operativos --- */
.dash-stats {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--el-space-2);
}
.dash-stat {
    display: flex; flex-direction: column; gap: 4px;
    padding: var(--el-space-2) var(--el-space-3);
    background: var(--el-bg); border: 1px solid var(--el-border);
    border-radius: var(--el-radius-sm); text-decoration: none;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.dash-stat:hover { border-color: var(--el-border-strong); transform: translateY(-2px); box-shadow: var(--el-shadow); }
.dash-stat-ico { color: var(--el-text-muted); }
.dash-stat-ico .app-ico { width: 20px; height: 20px; }
.dash-stat-num { font-size: 1.5rem; font-weight: 600; color: var(--el-text); line-height: 1; }
.dash-stat-label { font-size: .76rem; color: var(--el-text-muted); }

/* --- Rejillas --- */
.dash-grid { display: grid; gap: var(--el-space-3); }
.dash-grid-3 { grid-template-columns: repeat(3, 1fr); }
.dash-grid-charts { grid-template-columns: 1.3fr 1fr 1.3fr; align-items: start; }

/* --- Tarjetas de lista operativa --- */
.dash-list-body { display: flex; flex-direction: column; }
.dash-verlink { font-size: .8rem; color: var(--el-text-muted); text-decoration: none; }
.dash-verlink:hover { color: var(--el-text); }
.dash-vacio { color: var(--el-text-muted); font-size: .86rem; padding: var(--el-space-2) var(--el-space-3); margin: 0; }

.dash-row {
    display: flex; align-items: center; gap: var(--el-space-2);
    padding: 12px var(--el-space-3);
    border-top: 1px solid var(--el-border); text-decoration: none;
    transition: background .12s;
}
.dash-row:first-child { border-top: none; }
.dash-row:hover { background: var(--el-surface); }
.dash-row-hora {
    font-size: .82rem; font-weight: 600; color: var(--el-text);
    min-width: 42px; font-variant-numeric: tabular-nums;
}
.dash-row-ico { color: var(--el-text-muted); display: inline-flex; }
.dash-row-ico .app-ico { width: 18px; height: 18px; }
.dash-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dash-row-title { font-size: .88rem; font-weight: 600; color: var(--el-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-sub { font-size: .78rem; color: var(--el-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-when { font-size: .74rem; color: var(--el-text-muted); white-space: nowrap; }
.dash-row-go { color: var(--el-text-muted); display: inline-flex; }
.dash-row-go .app-ico { width: 16px; height: 16px; }
.dash-row:hover .dash-row-go { color: var(--el-text); }

/* --- Alertas --- */
.dash-alertas-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--el-space-2); padding: var(--el-space-3); }
.dash-alerta {
    display: flex; align-items: center; gap: var(--el-space-2);
    padding: 12px var(--el-space-2);
    border: 1px solid var(--el-border); border-left-width: 3px;
    border-radius: var(--el-radius-sm); background: var(--el-bg);
    text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.dash-alerta:hover { box-shadow: var(--el-shadow); transform: translateY(-1px); }
.dash-alerta.is-warning { border-left-color: #c98a1a; }
.dash-alerta.is-info { border-left-color: #1f5f9e; }
.dash-alerta.is-neutro { border-left-color: var(--el-border-strong); }
.dash-alerta-ico { color: var(--el-text-muted); display: inline-flex; }
.dash-alerta-ico .app-ico { width: 20px; height: 20px; }
.dash-alerta-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dash-alerta-txt { font-size: .86rem; font-weight: 600; color: var(--el-text); }
.dash-alerta-sub { font-size: .76rem; color: var(--el-text-muted); }

/* --- Separador de sección --- */
.dash-sep { display: flex; align-items: center; gap: var(--el-space-3); margin-top: var(--el-space-2); }
.dash-sep-title { font-size: 1rem; font-weight: 600; color: var(--el-text); margin: 0; white-space: nowrap; }
.dash-sep-line { flex: 1; height: 1px; background: var(--el-border); }

/* --- KPIs del resumen --- */
.dash-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--el-space-2); }
.dash-kpi { display: flex; flex-direction: column; gap: 4px; }
.dash-kpi-delta { font-size: .74rem; font-weight: 600; }
.dash-kpi-delta.tono-up { color: var(--el-success); }
.dash-kpi-delta.tono-flat { color: var(--el-text-muted); }
.dash-kpi-delta.tono-down { color: var(--el-error); }

/* --- Gráfica de barras --- */
.dash-bars { display: flex; align-items: flex-end; gap: var(--el-space-2); height: 180px; padding-top: var(--el-space-2); }
.dash-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.dash-bar-val { font-size: .78rem; font-weight: 600; color: var(--el-text); }
.dash-bar-fill { width: 100%; max-width: 46px; background: linear-gradient(180deg, #2a2a30, #0b0b0d); border-radius: 6px 6px 0 0; min-height: 6px; }
.dash-bar-label { font-size: .74rem; color: var(--el-text-muted); }

/* --- Donut de conversión --- */
.dash-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--el-space-2); }
.dash-donut-num { font-size: 1.4rem; font-weight: 700; fill: var(--el-text); }
.dash-donut-cap { font-size: .28rem; fill: var(--el-text-muted); }
.dash-donut-foot { font-size: .8rem; color: var(--el-text-muted); text-align: center; margin: 0; }

.dash-tl-link { text-decoration: none; }

/* --- Responsive --- */
@media (max-width: 1100px) {
    .dash-stats { grid-template-columns: repeat(3, 1fr); }
    .dash-kpis { grid-template-columns: repeat(3, 1fr); }
    .dash-grid-3 { grid-template-columns: 1fr 1fr; }
    .dash-grid-charts { grid-template-columns: 1fr 1fr; }
    .dash-alertas-body { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .dash-hero { flex-direction: column; align-items: flex-start; }
    .dash-hero-date { text-align: left; }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-kpis { grid-template-columns: repeat(2, 1fr); }
    .dash-grid-3, .dash-grid-charts { grid-template-columns: 1fr; }
}

/* ============================================================= *
 *  BackOffice · Agenda comercial (Sprint 2)                     *
 *  Vista de semana y día, filtros y panel de detalle.           *
 * ============================================================= */

.agenda { display: flex; flex-direction: column; gap: var(--el-space-3); }

/* --- Colores por tipo de cita --- */
.agenda-cita.is-comercial, .agenda-day-cita.is-comercial, .agenda-detail-head.is-comercial { --tipo-color: #1f5f9e; }
.agenda-cita.is-prueba, .agenda-day-cita.is-prueba, .agenda-detail-head.is-prueba { --tipo-color: #0b7d63; }
.agenda-cita.is-entrega, .agenda-day-cita.is-entrega, .agenda-detail-head.is-entrega { --tipo-color: #1a7f4b; }
.agenda-cita.is-video, .agenda-day-cita.is-video, .agenda-detail-head.is-video { --tipo-color: #7a3fb0; }
.agenda-cita.is-taller, .agenda-day-cita.is-taller, .agenda-detail-head.is-taller { --tipo-color: #b6791a; }

/* --- Toolbar --- */
.agenda-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--el-space-3); flex-wrap: wrap; padding: var(--el-space-2) var(--el-space-3);
}
.agenda-toolbar-left { display: flex; align-items: center; gap: var(--el-space-3); flex-wrap: wrap; }
.agenda-switch { display: inline-flex; background: var(--el-surface-2); border-radius: 10px; padding: 3px; }
.agenda-switch-btn {
    padding: 7px 16px; border-radius: 8px; font-size: .85rem; font-weight: 600;
    color: var(--el-text-muted); text-decoration: none; transition: background .15s, color .15s;
}
.agenda-switch-btn.is-active { background: var(--el-bg); color: var(--el-text); box-shadow: var(--el-shadow); }
.agenda-rango { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--el-text); }
.agenda-rango-ico { color: var(--el-text-muted); display: inline-flex; }
.agenda-rango-ico .app-ico { width: 18px; height: 18px; }
.agenda-filtros { display: flex; gap: var(--el-space-2); flex-wrap: wrap; }
.agenda-select { min-width: 150px; }

/* --- Layout principal (calendario a ancho completo) --- */
.agenda-layout { display: block; }
.agenda-main { display: flex; flex-direction: column; gap: var(--el-space-3); min-width: 0; }

/* --- Vista semana --- */
.agenda-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--el-space-2); }
.agenda-col { background: var(--el-bg); border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.agenda-col.is-finde { background: var(--el-surface); }
.agenda-col.is-hoy { border-color: var(--el-text); box-shadow: var(--el-shadow); }
.agenda-col-head {
    display: flex; align-items: center; gap: 6px; padding: 10px 12px;
    border-bottom: 1px solid var(--el-border);
}
.agenda-col-dia { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--el-text-muted); font-weight: 600; }
.agenda-col-num { font-size: 1rem; font-weight: 700; color: var(--el-text); }
.agenda-col.is-hoy .agenda-col-num { color: var(--el-text); }
.agenda-col-hoy { margin-left: auto; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--el-text); color: #fff; padding: 2px 7px; border-radius: 6px; }
.agenda-col-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; min-height: 90px; }
.agenda-col-vacio { color: var(--el-border-strong); text-align: center; font-size: 1.1rem; padding: 8px 0; }

.agenda-cita {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 10px; border-radius: 8px; text-decoration: none;
    background: var(--el-surface); border-left: 3px solid var(--tipo-color, var(--el-border-strong));
    transition: transform .12s, box-shadow .12s;
}
.agenda-cita:hover { transform: translateY(-1px); box-shadow: var(--el-shadow); }
.agenda-cita.is-sel { box-shadow: 0 0 0 2px var(--el-text); }
.agenda-cita-hora { font-size: .78rem; font-weight: 700; color: var(--el-text); }
.agenda-cita-tipo { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tipo-color, var(--el-text-muted)); }
.agenda-cita-cliente { font-size: .82rem; font-weight: 600; color: var(--el-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-cita-veh { font-size: .74rem; color: var(--el-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Vista día --- */
.agenda-day-head { display: flex; align-items: baseline; justify-content: space-between; }
.agenda-day-count { font-size: .82rem; color: var(--el-text-muted); }
.agenda-day-body { display: flex; flex-direction: column; gap: var(--el-space-2); padding-top: var(--el-space-2); }
.agenda-day-cita {
    display: flex; align-items: center; gap: var(--el-space-3);
    padding: 14px var(--el-space-3); border: 1px solid var(--el-border);
    border-left: 4px solid var(--tipo-color, var(--el-border-strong));
    border-radius: var(--el-radius-sm); text-decoration: none;
    transition: transform .12s, box-shadow .12s;
}
.agenda-day-cita:hover { transform: translateY(-1px); box-shadow: var(--el-shadow); }
.agenda-day-cita.is-sel { box-shadow: 0 0 0 2px var(--el-text); }
.agenda-day-time { display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.agenda-day-h1 { font-size: 1rem; font-weight: 700; color: var(--el-text); }
.agenda-day-h2 { font-size: .76rem; color: var(--el-text-muted); }
.agenda-day-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.agenda-day-tipo { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tipo-color, var(--el-text-muted)); }
.agenda-day-tipo .app-ico { width: 15px; height: 15px; }
.agenda-day-cliente { font-size: .95rem; font-weight: 600; color: var(--el-text); }
.agenda-day-sub { font-size: .8rem; color: var(--el-text-muted); }

/* --- Leyenda --- */
.agenda-leyenda { display: flex; flex-wrap: wrap; gap: var(--el-space-3); padding: 4px 2px; }
.agenda-ley-item { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--el-text-muted); }
.agenda-ley-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--tipo-color, var(--el-border-strong)); }
.agenda-ley-dot.is-comercial { --tipo-color: #1f5f9e; }
.agenda-ley-dot.is-prueba { --tipo-color: #0b7d63; }
.agenda-ley-dot.is-entrega { --tipo-color: #1a7f4b; }
.agenda-ley-dot.is-video { --tipo-color: #7a3fb0; }
.agenda-ley-dot.is-taller { --tipo-color: #b6791a; }

/* --- Panel de detalle --- */
.agenda-detail { position: sticky; top: var(--el-space-3); padding: 0; overflow: hidden; }
.agenda-detail-empty { padding: var(--el-space-4) var(--el-space-3); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.agenda-detail-empty-ico { color: var(--el-border-strong); }
.agenda-detail-empty-ico .app-ico { width: 40px; height: 40px; }
.agenda-detail-empty-t { font-weight: 600; color: var(--el-text); margin: 6px 0 0; }
.agenda-detail-empty-s { font-size: .84rem; color: var(--el-text-muted); margin: 0; }
.agenda-detail-resumen { margin-top: var(--el-space-3); display: flex; flex-direction: column; gap: 2px; }

.agenda-detail-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--el-space-3); border-bottom: 1px solid var(--el-border);
    border-top: 4px solid var(--tipo-color, var(--el-text));
}
.agenda-detail-tipo { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tipo-color, var(--el-text)); }
.agenda-detail-head-right { display: inline-flex; align-items: center; gap: 10px; }
.agenda-detail-dialog .agenda-detail-head { border-radius: var(--el-radius) var(--el-radius) 0 0; }
.agenda-detail-tipo .app-ico { width: 16px; height: 16px; }
.agenda-detail-body { padding: var(--el-space-3); display: flex; flex-direction: column; gap: var(--el-space-3); }
.agenda-detail-cliente { font-size: 1.2rem; font-weight: 600; margin: 0; color: var(--el-text); }
.agenda-detail-when { display: flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--el-text-muted); margin: 0; }
.agenda-detail-when .app-ico { width: 15px; height: 15px; }
.agenda-detail-datos { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.agenda-detail-datos > div { display: flex; justify-content: space-between; gap: var(--el-space-2); border-bottom: 1px solid var(--el-border); padding-bottom: 8px; }
.agenda-detail-datos dt { font-size: .8rem; color: var(--el-text-muted); margin: 0; }
.agenda-detail-datos dd { font-size: .86rem; font-weight: 600; color: var(--el-text); margin: 0; text-align: right; }
.agenda-detail-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--el-text-muted); font-weight: 600; margin-bottom: 8px; }
.agenda-detail-notas p { font-size: .86rem; color: var(--el-text); margin: 0; line-height: 1.5; }
.agenda-detail-acciones { display: flex; flex-direction: column; gap: 8px; }
.agenda-detail-acciones .bo-btn { width: 100%; }
.agenda-detail-links { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--el-border); padding-top: var(--el-space-3); }
.agenda-detail-links .bo-btn { width: 100%; justify-content: flex-start; }

/* --- Responsive --- */
@media (max-width: 1100px) {
    .agenda-layout { grid-template-columns: 1fr; }
    .agenda-detail { position: static; }
    .agenda-week { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
    .agenda-toolbar { flex-direction: column; align-items: stretch; }
    .agenda-filtros { flex-direction: column; }
    .agenda-select { min-width: 0; width: 100%; }
    .agenda-week { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================= *
 *  BackOffice · Agenda · estados y modales (Sprint 2)           *
 * ============================================================= */

/* --- Cita realizada (semana) --- */
.agenda-cita.is-realizada { background: #f2f8f4; opacity: .92; }
.agenda-cita.is-realizada .agenda-cita-cliente { color: var(--el-text-muted); }
.agenda-cita-ok { color: var(--el-success); display: inline-flex; vertical-align: middle; margin-left: 4px; }
.agenda-cita-ok .app-ico { width: 13px; height: 13px; }

/* --- Cita caducada (semana) --- */
.agenda-cita.is-caducada { background: #fdf3f2; }
.agenda-cita.is-caducada .agenda-cita-hora { color: var(--el-error); }
.agenda-cita-flag {
    display: inline-block; margin-top: 3px; font-size: .58rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em; color: #fff;
    background: var(--el-error); padding: 1px 6px; border-radius: 5px; line-height: 1.5;
}

/* --- Cita realizada / caducada (día) --- */
.agenda-day-cita.is-realizada { background: #f2f8f4; }
.agenda-day-cita.is-realizada .agenda-day-cliente { color: var(--el-text-muted); }
.agenda-day-cita.is-caducada { background: #fdf3f2; }
.agenda-day-concl {
    display: inline-flex; align-items: flex-start; gap: 6px; margin-top: 4px;
    font-size: .8rem; color: #256b45; line-height: 1.4;
}
.agenda-day-concl .app-ico { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: var(--el-success); }
.agenda-day-estado { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.agenda-badge-caducada {
    font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: #fff; background: var(--el-error); padding: 2px 7px; border-radius: 6px;
}

/* --- Detalle: aviso caducada, conclusiones y sello realizada --- */
.agenda-detail-head.is-realizada { border-top-color: var(--el-success); }
.agenda-detail-head.is-caducada { border-top-color: var(--el-error); }
.agenda-detail-aviso {
    display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 500;
    color: #8a2a20; background: #fdf3f2; border: 1px solid #f3d3cf;
    padding: 10px 12px; border-radius: var(--el-radius-sm);
}
.agenda-detail-aviso .app-ico { width: 17px; height: 17px; flex-shrink: 0; }
.agenda-detail-concl { background: #f2f8f4; border: 1px solid #cfe6d8; border-radius: var(--el-radius-sm); padding: 12px; }
.agenda-detail-concl.is-empty { display: none; }
.agenda-detail-concl .agenda-detail-label { display: inline-flex; align-items: center; gap: 6px; color: #256b45; margin-bottom: 6px; }
.agenda-detail-concl .agenda-detail-label .app-ico { width: 14px; height: 14px; }
.agenda-detail-concl p { font-size: .86rem; color: var(--el-text); margin: 0; line-height: 1.5; }
.agenda-detail-done {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center; width: 100%;
    font-size: .9rem; font-weight: 600; color: #256b45;
    background: #f2f8f4; border: 1px solid #cfe6d8; border-radius: 10px; padding: 11px 16px;
}
.agenda-detail-done .app-ico { width: 17px; height: 17px; color: var(--el-success); }

/* --- Modales --- */
.agenda-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: var(--el-space-3); }
.agenda-modal[hidden] { display: none; }
.agenda-modal-overlay { position: absolute; inset: 0; background: rgba(10, 10, 12, .55); backdrop-filter: blur(2px); }
.agenda-modal-dialog { position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 0; }
.agenda-modal-sm { max-width: 460px; }
.agenda-modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--el-space-3); border-bottom: 1px solid var(--el-border); position: sticky; top: 0; background: var(--el-bg); }
.agenda-modal-x { border: none; background: transparent; color: var(--el-text-muted); cursor: pointer; display: inline-flex; padding: 4px; border-radius: 8px; transition: background .15s, color .15s; }
.agenda-modal-x:hover { background: var(--el-surface); color: var(--el-text); }
.agenda-modal-x .app-ico { width: 20px; height: 20px; }
.agenda-modal-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--el-space-3); padding: var(--el-space-3); }
.agenda-field { display: flex; flex-direction: column; gap: 6px; }
.agenda-field-full { grid-column: 1 / -1; }
.agenda-field label { font-size: .78rem; font-weight: 600; color: var(--el-text-muted); }
.agenda-field .crm-select { width: 100%; }
.agenda-field textarea.crm-select { resize: vertical; font-family: inherit; }
.agenda-field-horas { display: grid; grid-template-columns: 1fr 1fr; gap: var(--el-space-2); }
.agenda-field-horas > div { display: flex; flex-direction: column; gap: 6px; }
.agenda-modal-foot { display: flex; justify-content: flex-end; gap: var(--el-space-2); border-top: 1px solid var(--el-border); padding-top: var(--el-space-3); }

@media (max-width: 560px) {
    .agenda-modal-form { grid-template-columns: 1fr; }
}

/* ======================================================================
   VEHÍCULOS · Gestor de stock interno (BackOffice)
   ====================================================================== */
.bo-modal-lg { max-width: 760px; }

/* --- KPIs --- */
.stock-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.stock-kpi { display: flex; align-items: center; gap: 12px; padding: 16px; }
.stock-kpi-ico { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: var(--el-surface-2); display: grid; place-items: center; color: var(--el-text); }
.stock-kpi-ico .app-ico { width: 20px; height: 20px; }
.stock-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.stock-kpi-sub { font-size: 0.74rem; color: var(--el-text-muted); margin-top: 2px; }

/* --- Aviso de categoría / acceso --- */
.stock-acceso { display: flex; gap: 12px; align-items: flex-start; background: #f4effe; border: 1px solid #e3d6fb; border-radius: var(--el-radius); padding: 12px 16px; margin-bottom: 16px; }
.stock-acceso-ico { color: #6d28d9; flex-shrink: 0; display: inline-flex; }
.stock-acceso-ico .app-ico { width: 20px; height: 20px; }
.stock-acceso p { margin: 0; font-size: 0.84rem; color: var(--el-text); line-height: 1.5; }

/* --- Toolbar / filtros --- */
.stock-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; }
.stock-search { position: relative; flex: 1 1 280px; min-width: 220px; }
.stock-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--el-text-muted); display: inline-flex; }
.stock-search-ico .app-ico { width: 17px; height: 17px; }
.stock-search-input { width: 100%; border: 1px solid var(--el-border); border-radius: 10px; padding: 9px 14px 9px 36px; font-size: 0.9rem; }
.stock-search-input:focus { outline: none; border-color: var(--el-border-strong); }
.stock-selects { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-selects .crm-select { min-width: 130px; }
.stock-resumen { font-size: 0.82rem; color: var(--el-text-muted); margin: 4px 2px 14px; }

/* --- Grid + tarjetas --- */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.stock-card { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.stock-card:hover { box-shadow: var(--el-shadow-lg); }
.stock-card.is-vendido { opacity: 0.85; }
.stock-card-media { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--el-surface-2); overflow: hidden; }
.stock-card-media img { width: 100%; height: 100%; object-fit: cover; }
.stock-card-flags { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.stock-flag { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.92); border-radius: 999px; padding: 4px 8px; font-size: 0.72rem; font-weight: 600; box-shadow: var(--el-shadow); }
.stock-flag .app-ico { width: 14px; height: 14px; }
.stock-flag.is-dest { color: #b6791a; }
.stock-flag.is-pub { color: var(--el-success); }
.stock-flag.is-unpub { color: var(--el-text-muted); }

/* Chip de categoría */
.stock-cat { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: .01em; }
.stock-cat.is-cat-nuevo     { color: #1d4ed8; background: #eef3ff; }
.stock-cat.is-cat-km0       { color: #0f766e; background: #e6f6f3; }
.stock-cat.is-cat-gerencia  { color: #6d28d9; background: #f1e9fe; }
.stock-cat.is-cat-ocasion   { color: #b45309; background: #fdf3e2; }
.stock-cat.is-cat-comercial { color: #334155; background: #eaeef4; }
.stock-cat-lock { position: absolute; top: 10px; left: 118px; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(109,40,217,.12); color: #6d28d9; }
.stock-cat-lock .app-ico { width: 14px; height: 14px; }

.stock-card-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; flex: 1; }
.stock-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stock-card-title { font-size: 1rem; font-weight: 600; margin: 0; line-height: 1.2; }
.stock-card-version { font-size: 0.8rem; color: var(--el-text-muted); margin: 2px 0 0; }
.stock-card-specs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.stock-card-specs li { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--el-text); }
.stock-card-specs .app-ico { width: 14px; height: 14px; color: var(--el-text-muted); flex-shrink: 0; }
.stock-card-precio { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--el-border); padding-top: 10px; }
.stock-precio { font-size: 1.2rem; font-weight: 700; }
.stock-cuota { font-size: 0.8rem; color: var(--el-text-muted); }
.stock-card-rel { display: flex; gap: 14px; }
.stock-rel-item { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--el-text-muted); }
.stock-rel-item .app-ico { width: 15px; height: 15px; }
.stock-card-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.stock-card-actions > .bo-btn { flex: 1; justify-content: center; }

/* Menú de acciones */
.stock-menu { position: relative; }
.stock-menu-list { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 190px; background: var(--el-bg); border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); box-shadow: var(--el-shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.stock-menu-list button { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 0.85rem; color: var(--el-text); cursor: pointer; text-align: left; }
.stock-menu-list button:hover { background: var(--el-surface); }
.stock-menu-list .app-ico { width: 16px; height: 16px; color: var(--el-text-muted); }

.stock-empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* --- Ficha (modal) --- */
.stock-ficha { display: flex; flex-direction: column; gap: 18px; }
.stock-ficha-galeria { position: relative; border-radius: var(--el-radius); overflow: hidden; background: var(--el-surface-2); aspect-ratio: 16 / 8; }
.stock-ficha-galeria img { width: 100%; height: 100%; object-fit: cover; }
.stock-ficha-galeria-flags { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.stock-ficha-precio { display: flex; align-items: center; gap: 12px; }
.stock-ficha-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--el-text-muted); font-weight: 700; margin-bottom: 8px; }
.stock-ficha-block { }
.stock-ficha-hint { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--el-text-muted); margin: -2px 0 10px; }
.stock-ficha-hint .app-ico { width: 15px; height: 15px; flex-shrink: 0; }
.stock-ficha-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stock-ficha-selects label { display: flex; flex-direction: column; gap: 5px; font-size: 0.76rem; color: var(--el-text-muted); font-weight: 600; }
.stock-ficha-selects .crm-select:disabled { background: var(--el-surface); color: var(--el-text); opacity: 1; cursor: default; }
.stock-ficha-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 0; }
.stock-ficha-datos > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--el-border); padding-bottom: 7px; }
.stock-ficha-datos dt { font-size: 0.8rem; color: var(--el-text-muted); margin: 0; }
.stock-ficha-datos dd { font-size: 0.84rem; font-weight: 600; margin: 0; text-align: right; }
.stock-ficha-estados { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stock-ficha-pub { display: flex; gap: 8px; flex-wrap: wrap; }
.stock-ficha-equip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stock-ficha-equip li { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; }
.stock-ficha-equip .app-ico { width: 15px; height: 15px; color: var(--el-success); flex-shrink: 0; }
.stock-ficha-cliente-row, .stock-ficha-lead { display: flex; align-items: center; gap: 12px; }
.stock-ficha-cliente-row .bo-btn { margin-left: auto; }
.stock-ficha-leads { display: flex; flex-direction: column; gap: 8px; }
.stock-ficha-lead { text-decoration: none; color: inherit; padding: 10px 12px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); transition: border-color .15s, background .15s; }
.stock-ficha-lead:hover { border-color: var(--el-border-strong); background: var(--el-surface); }
.stock-ficha-lead-main { display: flex; flex-direction: column; min-width: 0; }
.stock-ficha-lead-go { margin-left: auto; color: var(--el-text-muted); display: inline-flex; }
.stock-ficha-lead-go .app-ico { width: 16px; height: 16px; }
.stock-ficha-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stock-ficha-mini { display: flex; flex-direction: column; padding: 9px 12px; background: var(--el-surface); border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); margin-bottom: 8px; text-decoration: none; color: inherit; }
.stock-ficha-mini.is-link:hover { border-color: var(--el-border-strong); }
.stock-ficha-vacio { font-size: 0.82rem; margin: 0; }
.stock-ficha-timeline { list-style: none; margin: 0; padding: 0; }
.stock-ficha-timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.stock-ficha-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 1px; background: var(--el-border); }
.stock-ficha-tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--el-border-strong); margin-top: 5px; flex-shrink: 0; }
.stock-ficha-tl-body { display: flex; flex-direction: column; gap: 1px; }
.stock-ficha-tl-text { font-size: 0.85rem; }
.stock-ficha-tl-when { font-size: 0.74rem; color: var(--el-text-muted); }
.stock-ficha-acciones { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--el-border); padding-top: 16px; }

@media (max-width: 1200px) {
    .stock-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .stock-kpis { grid-template-columns: repeat(2, 1fr); }
    .stock-ficha-selects, .stock-ficha-datos, .stock-ficha-estados, .stock-ficha-equip, .stock-ficha-cols { grid-template-columns: 1fr; }
    .stock-selects .crm-select { flex: 1 1 45%; min-width: 0; }
}

/* ============================================================
   Clientes (BackOffice · visión 360º) — cli-*
   ============================================================ */
.cli { display: flex; flex-direction: column; gap: var(--el-space-3); }

/* KPIs */
.cli-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--el-space-3); }
.cli-kpi { display: flex; align-items: center; gap: 12px; padding: 16px; }
.cli-kpi-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--el-surface-2); display: grid; place-items: center; color: var(--el-text); }
.cli-kpi-ico .app-ico { width: 20px; height: 20px; }
.cli-kpi-body { display: flex; flex-direction: column; }

/* Toolbar */
.cli-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 16px; }
.cli-search { position: relative; flex: 1 1 280px; min-width: 220px; }
.cli-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--el-text-muted); display: grid; place-items: center; }
.cli-search-ico .app-ico { width: 16px; height: 16px; }
.cli-search-input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--el-border-strong); border-radius: var(--el-radius-sm); font-size: 0.88rem; background: #fff; }
.cli-search-input:focus { outline: none; border-color: var(--el-text); }
.cli-selects { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.cli-resumen { font-size: 0.8rem; color: var(--el-text-muted); padding: 0 2px; }
.cli-empty { text-align: center; padding: 40px 20px; }

/* Listado */
.cli-list { display: flex; flex-direction: column; gap: 10px; }
.cli-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(200px, 1.4fr) minmax(200px, 1.4fr) auto; gap: 16px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
.cli-row:hover { border-color: var(--el-border-strong); box-shadow: var(--el-shadow-lg); }
.cli-row-cliente { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cli-row-id { display: flex; flex-direction: column; min-width: 0; }
.cli-row-nombre { font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cli-row-contacto { font-size: 0.78rem; color: var(--el-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-row-meta { display: flex; flex-direction: column; gap: 4px; }
.cli-row-dato { font-size: 0.8rem; color: var(--el-text); }
.cli-row-lbl { display: inline-block; width: 62px; color: var(--el-text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.cli-row-estado { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.cli-row-ultima, .cli-row-proxima { font-size: 0.76rem; color: var(--el-text-muted); display: inline-flex; align-items: center; gap: 5px; }
.cli-row-ultima .app-ico, .cli-row-proxima .app-ico { width: 13px; height: 13px; }
.cli-row-ind { display: flex; align-items: center; gap: 6px; justify-self: end; }
.cli-ind { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--el-surface-2); color: var(--el-text-muted); }
.cli-ind .app-ico { width: 15px; height: 15px; }
.cli-ind.is-conv { background: #eef2ff; color: #3949ab; }
.cli-ind.is-cita { background: #f3e8ff; color: #7b2ff2; }
.cli-ind.is-taller { background: #fff4e5; color: #b8690a; }
.cli-ind.is-venta { background: #e7f6ee; color: var(--el-success); }
.cli-row-go { color: var(--el-text-muted); display: grid; place-items: center; }
.cli-row-go .app-ico { width: 16px; height: 16px; }

/* Chips de tipo */
.cli-tipo { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--el-border-strong); color: var(--el-text-muted); }
.cli-tipo.is-tipo-particular { background: var(--el-surface-2); }
.cli-tipo.is-tipo-empresa { background: #eef2ff; color: #3949ab; border-color: #d6dcff; }
.cli-tipo.is-tipo-flota { background: #e7f6ee; color: var(--el-success); border-color: #c5e8d3; }

/* Avatares por tipo */
.cli-avatar-empresa { background: #3949ab; }
.cli-avatar-flota { background: var(--el-success); }

/* Ficha 360 (modal) */
.cli-ficha { display: flex; flex-direction: column; gap: 18px; }
.cli-ficha-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.cli-ficha-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cli-ficha-block { display: flex; flex-direction: column; gap: 8px; }
.cli-ficha-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--el-text-muted); }
.cli-datalist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cli-datalist li { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; }
.cli-datalist li .app-ico { width: 16px; height: 16px; color: var(--el-text-muted); flex-shrink: 0; }
.cli-ficha-comercial { display: flex; flex-direction: column; gap: 10px; }
.cli-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--el-text-muted); }
.cli-field .crm-select { width: 100%; }
.cli-ficha-proxima { font-size: 0.82rem; margin: 2px 0 0; display: flex; align-items: center; gap: 6px; }
.cli-ficha-proxima .app-ico { width: 15px; height: 15px; color: var(--el-text-muted); }
.cli-vacio { font-size: 0.82rem; margin: 0; }

/* Vehículos en ficha */
.cli-veh { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); text-decoration: none; color: inherit; transition: border-color .15s ease; }
.cli-veh:hover { border-color: var(--el-border-strong); }
.cli-veh + .cli-veh { margin-top: 8px; }
.cli-veh.is-comprado { border-color: #c5e8d3; background: #f4fbf7; }
.cli-veh-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--el-surface-2); display: grid; place-items: center; }
.cli-veh-ico .app-ico { width: 17px; height: 17px; }
.cli-veh-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cli-veh-go { color: var(--el-text-muted); }
.cli-veh-go .app-ico { width: 15px; height: 15px; }

/* Mini rows (leads, citas) */
.cli-mini { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); text-decoration: none; color: inherit; transition: border-color .15s ease; }
.cli-mini + .cli-mini { margin-top: 8px; }
.cli-mini.is-link:hover { border-color: var(--el-border-strong); }
.cli-mini .crm-conv-name { display: inline-flex; align-items: center; gap: 6px; }
.cli-mini .crm-conv-name .app-ico { width: 14px; height: 14px; }

/* Chat en ficha */
.cli-chat { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; padding: 8px; background: var(--el-surface); border-radius: var(--el-radius-sm); }
.cli-chat-open { align-self: flex-start; }

/* Taller rows */
.cli-taller-row { display: grid; grid-template-columns: 1.2fr 1.4fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); text-decoration: none; color: inherit; font-size: 0.82rem; transition: border-color .15s ease; }
.cli-taller-row + .cli-taller-row { margin-top: 8px; }
.cli-taller-row.is-link:hover { border-color: var(--el-border-strong); }
.cli-taller-orden { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cli-taller-orden .app-ico { width: 14px; height: 14px; }
.cli-taller-veh { color: var(--el-text-muted); }
.cli-taller-estado { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; justify-self: start; }
.cli-taller-estado.is-en_curso { background: #fff4e5; color: #b8690a; }
.cli-taller-estado.is-esperando_piezas { background: #fdeaea; color: var(--el-error); }
.cli-taller-estado.is-finalizado { background: #e7f6ee; color: var(--el-success); }
.cli-taller-cuando { color: var(--el-text-muted); justify-self: end; }

/* Documentos */
.cli-docs { display: flex; flex-wrap: wrap; gap: 8px; }
.cli-doc { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); background: #fff; cursor: pointer; font-size: 0.82rem; color: inherit; transition: border-color .15s ease; }
.cli-doc:hover { border-color: var(--el-border-strong); }
.cli-doc-ico { display: grid; place-items: center; color: var(--el-text-muted); }
.cli-doc-ico .app-ico { width: 15px; height: 15px; }

/* Notas */
.cli-notas { display: flex; flex-direction: column; gap: 8px; }
.cli-nota { padding: 10px 12px; background: var(--el-surface); border-radius: var(--el-radius-sm); border: 1px solid var(--el-border); }
.cli-nota-texto { margin: 0 0 4px; font-size: 0.84rem; }
.cli-nota-meta { font-size: 0.72rem; color: var(--el-text-muted); }
.cli-nota-form { display: flex; gap: 8px; margin-top: 4px; }
.cli-nota-form .crm-compose-input { flex: 1; }

@media (max-width: 1100px) {
    .cli-kpis { grid-template-columns: repeat(3, 1fr); }
    .cli-row { grid-template-columns: 1fr 1fr; }
    .cli-row-ind { justify-self: start; }
}
@media (max-width: 720px) {
    .cli-kpis { grid-template-columns: repeat(2, 1fr); }
    .cli-row { grid-template-columns: 1fr; }
    .cli-ficha-cols { grid-template-columns: 1fr; }
    .cli-taller-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Ventas y Oportunidades (BackOffice · pipeline) — ven-*
   ============================================================ */
.ven { display: flex; flex-direction: column; gap: var(--el-space-3); }

/* KPIs */
.ven-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--el-space-3); }
.ven-kpi { display: flex; align-items: center; gap: 12px; padding: 16px; }
.ven-kpi-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--el-surface-2); display: grid; place-items: center; color: var(--el-text); }
.ven-kpi-ico .app-ico { width: 20px; height: 20px; }
.ven-kpi-body { display: flex; flex-direction: column; }

/* Toolbar (reutiliza .cli-selects) */
.ven-toolbar { padding: 14px 16px; }

/* Board / pipeline */
.ven-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.ven-col { flex: 0 0 268px; display: flex; flex-direction: column; background: var(--el-surface); border: 1px solid var(--el-border); border-radius: var(--el-radius); scroll-snap-align: start; min-height: 160px; }
.ven-col.is-dragover { border-color: var(--el-text); box-shadow: var(--el-shadow-lg); }
.ven-col-head { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 8px; padding: 12px 14px; border-bottom: 2px solid var(--el-border-strong); border-radius: var(--el-radius) var(--el-radius) 0 0; }
.ven-col-titulo { font-weight: 600; font-size: 0.82rem; }
.ven-col-count { grid-row: 1; justify-self: end; font-size: 0.72rem; font-weight: 600; background: var(--el-text); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.ven-col-importe { grid-column: 1 / -1; font-size: 0.74rem; color: var(--el-text-muted); }

/* Acentos por etapa (borde superior de la columna) */
.ven-col-head.is-nueva { border-bottom-color: #9aa0a6; }
.ven-col-head.is-contactado { border-bottom-color: #3949ab; }
.ven-col-head.is-oferta { border-bottom-color: #7b2ff2; }
.ven-col-head.is-negociacion { border-bottom-color: #b8690a; }
.ven-col-head.is-reserva { border-bottom-color: #0b8fd6; }
.ven-col-head.is-financiacion { border-bottom-color: #c99700; }
.ven-col-head.is-entrega { border-bottom-color: #1a7f4b; }
.ven-col-head.is-ganada { border-bottom-color: var(--el-success); }
.ven-col-head.is-perdida { border-bottom-color: var(--el-error); }

.ven-col-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; flex: 1; }
.ven-col-empty { font-size: 0.78rem; color: var(--el-text-muted); text-align: center; padding: 16px 8px; margin: 0; border: 1px dashed var(--el-border-strong); border-radius: var(--el-radius-sm); }

/* Tarjeta de oportunidad */
.ven-card { background: #fff; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease; }
.ven-card:hover { border-color: var(--el-border-strong); box-shadow: var(--el-shadow-lg); }
.ven-card:focus-visible { outline: 2px solid var(--el-text); outline-offset: 2px; }
.ven-card.is-dragging { opacity: 0.5; transform: scale(0.98); }
.ven-card.is-vencida { border-color: #f3c6c0; }
.ven-card.is-cerrada { background: var(--el-surface); }
.ven-card-top { display: flex; align-items: center; gap: 9px; }
.ven-card-top .crm-lead-avatar { width: 32px; height: 32px; font-size: 0.78rem; }
.ven-card-cli { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ven-card-nombre { font-weight: 600; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ven-card-veh { font-size: 0.74rem; color: var(--el-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ven-prio { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ven-prio.is-prio-alta { background: var(--el-error); }
.ven-prio.is-prio-media { background: #c99700; }
.ven-prio.is-prio-baja { background: #9aa0a6; }
.ven-card-importe { font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; }
.ven-card-meta { display: flex; flex-direction: column; gap: 3px; }
.ven-card-dato { font-size: 0.75rem; color: var(--el-text-muted); display: inline-flex; align-items: center; gap: 6px; }
.ven-card-dato .app-ico { width: 13px; height: 13px; }
.ven-card-dato.is-vencida { color: var(--el-error); font-weight: 600; }

.ven-prob { display: flex; align-items: center; gap: 8px; }
.ven-prob-bar { flex: 1; height: 5px; background: var(--el-surface-2); border-radius: 999px; overflow: hidden; }
.ven-prob-fill { display: block; height: 100%; background: var(--el-text); border-radius: 999px; }
.ven-prob-num { font-size: 0.7rem; color: var(--el-text-muted); font-weight: 600; min-width: 30px; text-align: right; }

.ven-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ven-tag { font-size: 0.68rem; padding: 2px 8px; border-radius: 999px; background: var(--el-surface-2); color: var(--el-text-muted); }

/* Panel lateral (modal) */
.ven-badge { font-size: 0.7rem; }
.ven-badge.is-nueva { background: #eef0f2; color: #5f6368; }
.ven-badge.is-contactado { background: #eef2ff; color: #3949ab; }
.ven-badge.is-oferta { background: #f3e8ff; color: #7b2ff2; }
.ven-badge.is-negociacion { background: #fff4e5; color: #b8690a; }
.ven-badge.is-reserva { background: #e5f4fd; color: #0b6ea8; }
.ven-badge.is-financiacion { background: #fdf4d6; color: #8a6d00; }
.ven-badge.is-entrega { background: #e7f6ee; color: #1a7f4b; }
.ven-badge.is-ganada { background: #e7f6ee; color: var(--el-success); }
.ven-badge.is-perdida { background: #fdeaea; color: var(--el-error); }

.ven-nota-ganada, .ven-nota-perdida { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--el-radius-sm); font-size: 0.84rem; }
.ven-nota-ganada { background: #eafaf1; color: #14663c; }
.ven-nota-ganada .app-ico { color: var(--el-success); }
.ven-nota-perdida { background: #fdeaea; color: #9a2c22; }
.ven-nota-ganada .app-ico, .ven-nota-perdida .app-ico { width: 18px; height: 18px; flex-shrink: 0; }

.ven-acciones { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--el-surface); border-radius: var(--el-radius-sm); }
.ven-etapa-field { max-width: 260px; }
.ven-acciones-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.ven-resumen-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 4px; }
.ven-resumen-datos > span { font-size: 0.82rem; display: flex; flex-direction: column; gap: 1px; }

/* Fases oferta/reserva/financiación */
.ven-fases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ven-fase { border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ven-fase.is-off { opacity: 0.6; }
.ven-fase-h { font-size: 0.78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.ven-fase-h .app-ico { width: 15px; height: 15px; }
.ven-fase-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ven-fase-list li { font-size: 0.78rem; display: flex; justify-content: space-between; gap: 8px; }
.ven-fase-list li span { color: var(--el-text-muted); }

@media (max-width: 1100px) {
    .ven-kpis { grid-template-columns: repeat(3, 1fr); }
    .ven-fases { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .ven-kpis { grid-template-columns: repeat(2, 1fr); }
    .ven-resumen-datos { grid-template-columns: 1fr; }
}

/* ============================================================
   Business Intelligence (BackOffice · análisis) — bi-*
   ============================================================ */
.bi { display: flex; flex-direction: column; gap: var(--el-space-3); }
.bi-block-title { font-size: 0.95rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.bi-block-title .app-ico { width: 17px; height: 17px; }
.bi-block-sub { font-size: 0.8rem; color: var(--el-text-muted); margin: 4px 0 0; }

/* KPIs (8) */
.bi-kpis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.bi-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.bi-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.bi-kpi-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--el-surface-2); display: grid; place-items: center; }
.bi-kpi-ico .app-ico { width: 16px; height: 16px; }
.bi-kpi-delta { font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.bi-kpi-delta.is-up { background: #e7f6ee; color: var(--el-success); }
.bi-kpi-delta.is-down { background: #fdeaea; color: var(--el-error); }
.bi-kpi .bo-kpi-value { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.bi-kpi .bo-kpi-label { font-size: 0.74rem; color: var(--el-text-muted); }

/* Constructor de consultas */
.bi-builder { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.bi-builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bi-builder-actions { display: flex; gap: 8px; flex-shrink: 0; }
.bi-builder-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.bi-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bi-field-label { font-size: 0.72rem; color: var(--el-text-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.bi-field-label .app-ico { width: 13px; height: 13px; }
.bi-field .crm-select { width: 100%; }

/* Consultas rápidas */
.bi-quick { display: flex; flex-direction: column; gap: 12px; }
.bi-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.bi-quick-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease; }
.bi-quick-card:hover { border-color: var(--el-border-strong); box-shadow: var(--el-shadow-lg); }
.bi-quick-card.is-active { border-color: var(--el-text); box-shadow: 0 0 0 1px var(--el-text); }
.bi-quick-ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: var(--el-surface-2); display: grid; place-items: center; }
.bi-quick-ico .app-ico { width: 19px; height: 19px; }
.bi-quick-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bi-quick-cat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--el-text-muted); font-weight: 600; }
.bi-quick-titulo { font-size: 0.86rem; font-weight: 600; line-height: 1.3; }
.bi-quick-badge { font-size: 0.74rem; color: var(--el-text-muted); margin-top: 2px; }

/* Main: resultado + visualización */
.bi-main { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: var(--el-space-3); align-items: start; }

.bi-result { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.bi-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bi-result-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bi-result-search { position: relative; }
.bi-result-search .cli-search-input { min-width: 200px; }

.bi-table-wrap { overflow-x: auto; }
.bi-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.bi-table thead th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--el-text-muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--el-border-strong); cursor: pointer; white-space: nowrap; user-select: none; }
.bi-table thead th span:first-child { margin-right: 4px; }
.bi-th-sort { display: inline-flex; opacity: 0; transition: opacity .15s ease; }
.bi-th-sort .app-ico { width: 12px; height: 12px; }
.bi-table thead th:hover .bi-th-sort { opacity: 0.5; }
.bi-table thead th.is-asc .bi-th-sort { opacity: 1; transform: rotate(-90deg); }
.bi-table thead th.is-desc .bi-th-sort { opacity: 1; transform: rotate(90deg); }
.bi-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--el-border); }
.bi-table tbody tr:hover { background: var(--el-surface); }
.bi-table tbody td:first-child { font-weight: 600; }
.bi-table-empty { font-size: 0.82rem; color: var(--el-text-muted); text-align: center; padding: 20px; margin: 0; }
.bi-result-foot { font-size: 0.76rem; color: var(--el-text-muted); }

/* Gráficas */
.bi-viz { display: flex; flex-direction: column; gap: var(--el-space-3); }
.bi-chart { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.bi-chart-title { font-size: 0.84rem; font-weight: 600; margin: 0; }
.bi-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 150px; }
.bi-bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; flex: 1; height: 100%; }
.bi-bar-val { font-size: 0.72rem; font-weight: 600; color: var(--el-text-muted); }
.bi-bar { width: 100%; max-width: 30px; min-height: 4px; background: linear-gradient(180deg, #2b2b2b, var(--el-text)); border-radius: 6px 6px 0 0; transition: height .3s ease; }
.bi-bar-lbl { font-size: 0.7rem; color: var(--el-text-muted); }

.bi-hbars { display: flex; flex-direction: column; gap: 10px; }
.bi-hbar { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px; }
.bi-hbar-lbl { font-size: 0.76rem; color: var(--el-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bi-hbar-track { height: 8px; background: var(--el-surface-2); border-radius: 999px; overflow: hidden; }
.bi-hbar-fill { display: block; height: 100%; background: var(--el-text); border-radius: 999px; transition: width .3s ease; }
.bi-hbar-val { font-size: 0.76rem; font-weight: 600; min-width: 24px; text-align: right; }

/* Oportunidades detectadas */
.bi-insights { display: flex; flex-direction: column; gap: 12px; }
.bi-insights-head { display: flex; flex-direction: column; gap: 2px; }
.bi-insights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.bi-insight { padding: 16px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.bi-insight-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--el-text); color: #fff; display: grid; place-items: center; }
.bi-insight-ico .app-ico { width: 18px; height: 18px; }
.bi-insight-texto { font-size: 0.86rem; margin: 0; line-height: 1.4; }
.bi-insight-num { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.bi-insight-accion { font-size: 0.78rem; font-weight: 600; text-decoration: none; color: var(--el-text); display: inline-flex; align-items: center; gap: 5px; }
.bi-insight-accion .app-ico { width: 13px; height: 13px; transition: transform .15s ease; }
.bi-insight-accion:hover .app-ico { transform: translateX(3px); }

@media (max-width: 1200px) {
    .bi-kpis { grid-template-columns: repeat(4, 1fr); }
    .bi-builder-grid { grid-template-columns: repeat(4, 1fr); }
    .bi-main { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .bi-kpis { grid-template-columns: repeat(2, 1fr); }
    .bi-builder-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================= *
 *  BackOffice · Centro de Operaciones de Posventa (tal-*)       *
 *  Tablero kanban de órdenes de reparación + ficha en modal.    *
 * ============================================================= */

.bo-badge.is-negociacion { color: #8a6d00; background: #fdf4d6; }

/* --- Tablero --- */
.tal-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.tal-col { flex: 0 0 260px; display: flex; flex-direction: column; background: var(--el-surface); border: 1px solid var(--el-border); border-radius: var(--el-radius); scroll-snap-align: start; min-height: 160px; }
.tal-col.is-dragover { border-color: var(--el-text); box-shadow: var(--el-shadow-lg); }
.tal-col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 2px solid var(--el-border-strong); border-radius: var(--el-radius) var(--el-radius) 0 0; }
.tal-col-ico { display: inline-flex; color: var(--el-text); }
.tal-col-ico .app-ico { width: 16px; height: 16px; }
.tal-col-titulo { font-weight: 600; font-size: 0.82rem; flex: 1; }
.tal-col-count { font-size: 0.72rem; font-weight: 600; background: var(--el-text); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }

/* Acento de color por estado (borde superior de la columna) */
.tal-col-head.is-recepcionado { border-bottom-color: #9aa0a6; }
.tal-col-head.is-diagnostico  { border-bottom-color: #3949ab; }
.tal-col-head.is-aprobacion   { border-bottom-color: #b8690a; }
.tal-col-head.is-piezas       { border-bottom-color: #c99700; }
.tal-col-head.is-reparacion   { border-bottom-color: #0b8fd6; }
.tal-col-head.is-calidad      { border-bottom-color: #7b2ff2; }
.tal-col-head.is-listo        { border-bottom-color: var(--el-success); }
.tal-col-head.is-entregado    { border-bottom-color: var(--el-text); }

.tal-col-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; flex: 1; }
.tal-col-empty { font-size: 0.78rem; color: var(--el-text-muted); text-align: center; padding: 16px 8px; margin: 0; border: 1px dashed var(--el-border-strong); border-radius: var(--el-radius-sm); }

/* --- Tarjeta de orden --- */
.tal-card { background: #fff; border: 1px solid var(--el-border); border-left: 3px solid var(--el-border-strong); border-radius: var(--el-radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease; }
.tal-card:hover { box-shadow: var(--el-shadow-lg); transform: translateY(-1px); }
.tal-card:focus-visible { outline: 2px solid var(--el-text); outline-offset: 2px; }
.tal-card.is-dragging { opacity: 0.5; transform: scale(0.98); }
.tal-card.is-prio-alta { border-left-color: var(--el-error); }
.tal-card.is-prio-media { border-left-color: #c99700; }
.tal-card.is-prio-baja { border-left-color: #9aa0a6; }

.tal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tal-plate { font-family: var(--el-font-mono, ui-monospace, monospace); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; background: var(--el-surface-2); border: 1px solid var(--el-border); border-radius: 5px; padding: 3px 8px; color: var(--el-text); }
.tal-plate.is-empty { font-family: inherit; font-weight: 500; font-size: 0.72rem; letter-spacing: 0; color: var(--el-text-muted); }
.tal-prio { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tal-prio.is-prio-alta { background: var(--el-error); }
.tal-prio.is-prio-media { background: #c99700; }
.tal-prio.is-prio-baja { background: #9aa0a6; }

.tal-card-veh { display: flex; flex-direction: column; }
.tal-card-modelo { font-weight: 600; font-size: 0.9rem; }
.tal-card-version { font-size: 0.75rem; color: var(--el-text-muted); }
.tal-card-cli { display: flex; align-items: center; gap: 8px; }
.tal-card-cli .crm-lead-avatar { width: 26px; height: 26px; font-size: 0.7rem; }
.tal-card-cli-nombre { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tal-card-meta { display: flex; flex-direction: column; gap: 3px; }
.tal-card-dato { font-size: 0.74rem; color: var(--el-text-muted); display: inline-flex; align-items: center; gap: 6px; }
.tal-card-dato .app-ico { width: 13px; height: 13px; }
.tal-card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tal-card-foot .bo-badge { font-size: 0.68rem; display: inline-flex; align-items: center; gap: 4px; }
.tal-card-foot .bo-badge .app-ico { width: 11px; height: 11px; }

/* --- Panel lateral (modal) --- */
.tal-modal-veh { font-weight: 500; font-size: 0.9rem; color: var(--el-text-muted); }
.tal-badge { display: inline-flex; align-items: center; gap: 5px; }
.tal-badge .app-ico { width: 13px; height: 13px; }
.tal-badge.is-recepcionado { background: #eef0f2; color: #5f6368; }
.tal-badge.is-diagnostico  { background: #eef2ff; color: #3949ab; }
.tal-badge.is-aprobacion   { background: #fff4e5; color: #b8690a; }
.tal-badge.is-piezas       { background: #fdf4d6; color: #8a6d00; }
.tal-badge.is-reparacion   { background: #e5f4fd; color: #0b6ea8; }
.tal-badge.is-calidad      { background: #f3e8ff; color: #7b2ff2; }
.tal-badge.is-listo        { background: #e7f6ee; color: var(--el-success); }
.tal-badge.is-entregado    { background: var(--el-surface-2); color: var(--el-text); }

.tal-nota-garantia, .tal-nota-sust { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--el-radius-sm); font-size: 0.85rem; }
.tal-nota-garantia { background: #e9f6ef; color: #1a7f4b; }
.tal-nota-sust { background: #eef3ff; color: #1d4ed8; }
.tal-nota-garantia .app-ico, .tal-nota-sust .app-ico { width: 18px; height: 18px; flex-shrink: 0; }

.tal-texto { font-size: 0.88rem; line-height: 1.5; margin: 0; }
.tal-obs { font-size: 0.82rem; color: var(--el-text-muted); display: flex; align-items: flex-start; gap: 7px; margin: 8px 0 0; }
.tal-obs .app-ico { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }

.tal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tal-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.85rem; padding: 9px 12px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); background: #fff; }
.tal-list-item .bo-badge { flex-shrink: 0; }
.tal-ref { display: block; font-size: 0.72rem; color: var(--el-text-muted); }

.tal-presu { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); background: var(--el-surface); }
.tal-presu-total { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }

.tal-fotos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tal-foto { width: 54px; height: 54px; border-radius: var(--el-radius-sm); border: 1px solid var(--el-border); background: var(--el-surface-2); color: var(--el-text-muted); display: grid; place-items: center; cursor: pointer; overflow: hidden; padding: 0; transition: border-color .15s ease; }
.tal-foto:hover { border-color: var(--el-border-strong); color: var(--el-text); }
.tal-foto .app-ico { width: 18px; height: 18px; }
.tal-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 900px) {
    .tal-board { gap: 10px; }
    .tal-col { flex-basis: 230px; }
}

/* ============================================================
   Organización, roles y permisos (BackOffice · Trabajadores)
   ============================================================ */
.tra { display: block; }

/* KPIs */
.tra-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.tra-kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.tra-kpi-ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--el-surface-2); display: grid; place-items: center; color: var(--el-text); }
.tra-kpi-ico .app-ico { width: 19px; height: 19px; }
.tra-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.tra-kpi-value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.tra-kpi-label { font-size: 0.74rem; color: var(--el-text-muted); }

/* Tabs */
.tra-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--el-border); overflow-x: auto; }
.tra-tab { display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; color: var(--el-text-muted); font-size: 0.86rem; font-weight: 600; padding: 10px 14px; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tra-tab .app-ico { width: 17px; height: 17px; }
.tra-tab:hover { color: var(--el-text); }
.tra-tab.is-active { color: var(--el-text); border-bottom-color: var(--el-text); }
.tra-panel { display: none; }
.tra-panel.is-active { display: block; }

/* Filtros */
.tra-filtros { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; margin-bottom: 16px; align-items: center; }
.tra-filtros-field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; background: var(--el-surface); border: 1px solid var(--el-border); border-radius: 999px; padding: 8px 14px; }
.tra-filtros-lbl { color: var(--el-text-muted); display: inline-flex; }
.tra-filtros-lbl .app-ico { width: 16px; height: 16px; }
.tra-input { border: none; background: transparent; flex: 1; font-size: 0.88rem; outline: none; color: var(--el-text); }
.tra-select { border: 1px solid var(--el-border); background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 0.82rem; font-weight: 600; color: var(--el-text); cursor: pointer; }
.tra-select:focus { outline: none; border-color: var(--el-border-strong); }

/* Grid de trabajadores */
.tra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tra-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; text-decoration: none; color: var(--el-text); transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease; }
.tra-card:hover { border-color: var(--el-border-strong); box-shadow: var(--el-shadow-lg); transform: translateY(-2px); }
.tra-card-head { display: flex; align-items: center; gap: 12px; }
.tra-card-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tra-card-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tra-card-cargo { font-size: 0.78rem; color: var(--el-text-muted); }
.tra-card-meta { display: flex; flex-direction: column; gap: 5px; }
.tra-meta-row { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--el-text); }
.tra-meta-row .app-ico { width: 15px; height: 15px; color: var(--el-text-muted); flex-shrink: 0; }
.tra-meta-muted { color: var(--el-text-muted); }
.tra-card-cats { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--el-border); }
.tra-cat { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--el-surface-2); color: var(--el-text); }
.tra-cat-none { background: transparent; border: 1px dashed var(--el-border-strong); color: var(--el-text-muted); }
.tra-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; }

/* Organigrama */
.tra-org-wrap { padding: 6px 0 10px; }
.tra-org-scroll { overflow-x: auto; padding: 18px 20px 10px; }
.tra-org-root, .tra-org-children { list-style: none; margin: 0; padding: 0; }
.tra-org-root { display: flex; flex-direction: column; gap: 18px; }
.tra-org-children { margin-left: 26px; padding-left: 20px; border-left: 2px solid var(--el-border); margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.tra-org-node { position: relative; }
.tra-org-card { display: inline-flex; align-items: center; gap: 12px; min-width: 280px; padding: 11px 14px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); background: #fff; text-decoration: none; color: var(--el-text); box-shadow: var(--el-shadow); transition: border-color 0.12s, box-shadow 0.12s; }
.tra-org-card:hover { border-color: var(--el-border-strong); box-shadow: var(--el-shadow-lg); }
.tra-org-avatar { width: 36px; height: 36px; font-size: 0.82rem; }
.tra-org-info { display: flex; flex-direction: column; min-width: 0; }
.tra-org-name { font-weight: 600; font-size: 0.9rem; }
.tra-org-cargo { font-size: 0.76rem; color: var(--el-text-muted); }
.tra-org-sede { font-size: 0.72rem; color: var(--el-text-muted); display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; }
.tra-org-sede .app-ico { width: 12px; height: 12px; }
.tra-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-left: auto; }
.tra-dot.is-ganado { background: var(--el-success); }
.tra-dot.is-nuevo { background: #2563eb; }
.tra-dot.is-perdido { background: var(--el-error); }
.tra-dot.is-neutro { background: var(--el-border-strong); }

/* Roles */
.tra-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tra-role { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.tra-role-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tra-role-name { font-weight: 700; font-size: 1rem; display: block; }
.tra-role-dep { font-size: 0.76rem; color: var(--el-text-muted); }
.tra-nivel-badge { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--el-text); color: #fff; white-space: nowrap; }
.tra-role-resumen { font-size: 0.84rem; color: var(--el-text-muted); margin: 0; line-height: 1.45; }
.tra-role-perms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tra-role-perms li { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.tra-role-perms .app-ico { width: 15px; height: 15px; color: var(--el-success); flex-shrink: 0; }
.tra-role-foot { display: flex; flex-direction: column; gap: 7px; padding-top: 12px; border-top: 1px solid var(--el-border); }
.tra-role-lbl { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--el-text-muted); }
.tra-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tra-chip { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--el-border); color: var(--el-text); }

/* Leyenda de permisos */
.tra-legend { margin-bottom: 16px; }
.tra-legend-body { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; padding: 4px 18px 18px; }
.tra-legend-col { display: flex; flex-direction: column; gap: 8px; }
.tra-niveles { display: flex; flex-direction: column; gap: 10px; }
.tra-nivel { display: flex; align-items: center; gap: 10px; }
.tra-nivel-desc { font-size: 0.78rem; color: var(--el-text-muted); }

/* Permisos especiales */
.tra-especiales { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 4px 18px 18px; }
.tra-especial { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--el-border); border-radius: var(--el-radius-sm); background: var(--el-surface); }
.tra-especial-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: #fff; border: 1px solid var(--el-border); display: grid; place-items: center; }
.tra-especial-ico .app-ico { width: 17px; height: 17px; }
.tra-especial-titulo { font-weight: 600; font-size: 0.86rem; display: block; }
.tra-especial-texto { font-size: 0.79rem; color: var(--el-text-muted); line-height: 1.4; }

/* Acceso efectivo */
.tra-efectivo { margin-bottom: 16px; }
.tra-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 18px 14px; }
.tra-formula-part { font-size: 0.82rem; font-weight: 600; padding: 7px 13px; border-radius: 10px; background: var(--el-surface-2); }
.tra-formula-op { font-size: 1rem; font-weight: 700; color: var(--el-text-muted); }
.tra-ejemplos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 0 18px 18px; }
.tra-ejemplo { display: flex; flex-direction: column; gap: 5px; padding: 13px; border-left: 3px solid var(--el-text); background: var(--el-surface); border-radius: 0 var(--el-radius-sm) var(--el-radius-sm) 0; }
.tra-ejemplo-n { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.84rem; }
.tra-ejemplo-n .app-ico { width: 15px; height: 15px; }
.tra-ejemplo-t { font-size: 0.8rem; color: var(--el-text-muted); line-height: 1.4; }

/* Matriz */
.tra-matriz-wrap { padding-bottom: 6px; }
.tra-matriz-scroll { overflow-x: auto; padding: 4px 4px 8px; }
.tra-matriz { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; }
.tra-matriz th, .tra-matriz td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--el-border); white-space: nowrap; }
.tra-matriz thead th { position: sticky; top: 0; background: var(--el-surface); font-size: 0.74rem; color: var(--el-text-muted); font-weight: 700; }
.tra-matriz-rol { text-align: left !important; position: sticky; left: 0; background: #fff; z-index: 1; }
.tra-matriz thead .tra-matriz-rol { z-index: 2; background: var(--el-surface); }
.tra-matriz-rol-name { font-weight: 600; display: block; }
.tra-matriz-rol-dep { font-size: 0.7rem; color: var(--el-text-muted); }
.tra-matriz-none { color: var(--el-border-strong); }
.tra-matriz tbody tr:hover td, .tra-matriz tbody tr:hover .tra-matriz-rol { background: var(--el-surface); }

/* Configuración futura */
.tra-futuras { margin-top: 20px; }
.tra-futuras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 4px 18px 18px; }
.tra-futura { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px dashed var(--el-border-strong); border-radius: var(--el-radius-sm); background: var(--el-surface); }
.tra-futura-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: #fff; border: 1px solid var(--el-border); display: grid; place-items: center; color: var(--el-text-muted); }
.tra-futura-ico .app-ico { width: 17px; height: 17px; }
.tra-futura-titulo { font-weight: 600; font-size: 0.84rem; display: block; }
.tra-futura-texto { font-size: 0.76rem; color: var(--el-text-muted); line-height: 1.35; }
.tra-futura-tag { margin-left: auto; align-self: flex-start; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--el-text-muted); background: var(--el-surface-2); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }

/* Modal de ficha */
.tra-modal-title { flex: 1; }
.tra-modal-body { padding: 0; }
.tra-acciones { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px var(--el-space-3); border-bottom: 1px solid var(--el-border); background: var(--el-surface); }
.tra-btn-danger { color: var(--el-error); }
.tra-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: var(--el-space-3); }
.tra-modal-col { display: flex; flex-direction: column; gap: 16px; }
.tra-block { display: flex; flex-direction: column; gap: 10px; }
.tra-block-hl { padding: 14px; border-radius: var(--el-radius-sm); background: var(--el-surface); border: 1px solid var(--el-border); }
.tra-datalist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tra-datalist li { display: flex; align-items: center; gap: 10px; font-size: 0.84rem; }
.tra-datalist .app-ico { width: 15px; height: 15px; color: var(--el-text-muted); flex-shrink: 0; }
.tra-role-inline { display: flex; flex-direction: column; gap: 3px; }
.tra-field { display: flex; flex-direction: column; gap: 5px; }
.tra-field-val { font-size: 0.85rem; }
.tra-equipo { display: flex; flex-direction: column; gap: 7px; }
.tra-mini { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--el-text); padding: 6px; border-radius: 8px; transition: background 0.12s; }
.tra-mini:hover { background: var(--el-surface); }
.tra-mini-av { width: 30px; height: 30px; font-size: 0.72rem; }
.tra-mini-n { font-weight: 600; font-size: 0.82rem; display: block; }
.tra-mini-c { font-size: 0.74rem; color: var(--el-text-muted); }
.tra-efectivo-frase { font-size: 0.86rem; font-weight: 600; margin: 0 0 4px; line-height: 1.4; }
.tra-acceso { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tra-acceso-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; background: var(--el-surface); }
.tra-acceso-mod { font-size: 0.84rem; font-weight: 600; }

@media (max-width: 900px) {
    .tra-kpis { grid-template-columns: repeat(2, 1fr); }
    .tra-legend-body, .tra-modal-grid { grid-template-columns: 1fr; }
}

/* Hub de Configuración */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cfg-card { display: flex; align-items: center; gap: 13px; padding: 16px; text-decoration: none; color: var(--el-text); }
.cfg-card.is-on { transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s; }
.cfg-card.is-on:hover { border-color: var(--el-border-strong); box-shadow: var(--el-shadow-lg); transform: translateY(-2px); }
.cfg-card:not(.is-on) { opacity: 0.72; }
.cfg-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--el-surface-2); display: grid; place-items: center; }
.cfg-ico .app-ico { width: 19px; height: 19px; }
.cfg-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cfg-titulo { font-weight: 600; font-size: 0.92rem; }
.cfg-texto { font-size: 0.79rem; color: var(--el-text-muted); line-height: 1.4; }
.cfg-go { color: var(--el-text-muted); display: inline-flex; }
.cfg-go .app-ico { width: 18px; height: 18px; }

/* Configuración · catálogos configurables */
.cfg-cat-note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 16px; background: var(--el-surface); }
.cfg-cat-note .app-ico { width: 20px; height: 20px; flex-shrink: 0; color: var(--el-text-muted); margin-top: 1px; }
.cfg-cat-note p { margin: 0; font-size: 0.83rem; color: var(--el-text-muted); line-height: 1.5; }
.cfg-cat-block { padding: 18px; margin-bottom: 16px; }
.cfg-cat-head { display: flex; align-items: center; gap: 13px; padding-bottom: 12px; border-bottom: 1px solid var(--el-border); margin-bottom: 6px; }
.cfg-cat-head > div { flex: 1; min-width: 0; }
.cfg-cat-title { font-size: 1rem; font-weight: 650; margin: 0; }
.cfg-cat-desc { font-size: 0.8rem; color: var(--el-text-muted); margin: 2px 0 0; line-height: 1.4; }
.cfg-cat-list { list-style: none; margin: 0; padding: 0; }
.cfg-cat-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--el-border); }
.cfg-cat-item:last-child { border-bottom: 0; }
.cfg-cat-item.is-off { opacity: 0.55; }
.cfg-cat-item-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cfg-cat-item-label { font-weight: 550; font-size: 0.9rem; }
.cfg-cat-item-extra { font-size: 0.77rem; color: var(--el-text-muted); }
.cfg-cat-badges { display: inline-flex; gap: 6px; flex-shrink: 0; }
.cfg-cat-actions { display: inline-flex; gap: 6px; flex-shrink: 0; }
.bo-iconbtn-sm { width: 32px; height: 32px; border-radius: 8px; }
.bo-iconbtn-sm .app-ico { width: 16px; height: 16px; }
.cfg-cat-toast { position: fixed; }
@media (max-width: 640px) {
    .cfg-cat-item { flex-wrap: wrap; }
    .cfg-cat-badges { order: 3; }
}

/* ============================================================
   Prueba dinámica · modal premium + transición cinematográfica
   ============================================================ */
.no-scroll { overflow: hidden; }

.app-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.app-modal-overlay { position: absolute; inset: 0; background: rgba(10, 10, 12, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s ease; }
.app-modal.is-open .app-modal-overlay { opacity: 1; }
.app-modal-dialog { position: relative; width: min(460px, 100%); background: #fff; border: 1px solid #ececec; border-radius: 20px; padding: 2.25rem 2rem 1.75rem; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); transform: translateY(14px) scale(.98); opacity: 0; transition: transform .24s cubic-bezier(.2, .8, .2, 1), opacity .24s ease; }
.app-modal.is-open .app-modal-dialog { transform: translateY(0) scale(1); opacity: 1; }
.app-modal-x { position: absolute; top: .85rem; right: .85rem; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #8a8a8a; border-radius: 10px; cursor: pointer; }
.app-modal-x:hover { background: #f4f4f4; color: #111; }
.app-modal-ico { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; background: #0f0f0f; color: #fff; margin-bottom: 1rem; }
.app-modal-ico .app-ico { width: 26px; height: 26px; }
.app-modal-title { font-size: 1.3rem; margin: 0 0 .6rem; }
.app-modal-text { color: #555; margin: 0 0 .4rem; line-height: 1.55; }
.app-modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.4rem; }
.app-modal-actions .btn { flex: 1 1 auto; }
.app-modal-note { font-size: .75rem; margin: .9rem 0 0; letter-spacing: .02em; }

/* Transición pública → privada */
.app-transicion { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; background: #0b0b0d; opacity: 0; transition: opacity .5s ease; }
.app-transicion.is-visible { opacity: 1; }
.app-transicion-logo { width: 168px; max-width: 60%; height: auto; opacity: 0; transform: translateY(8px); animation: appTransLogo .8s ease .1s forwards; }
.app-transicion-text { color: #d6d6d6; font-size: 1rem; letter-spacing: .01em; opacity: 0; animation: appTransText .8s ease .35s forwards; }
.app-transicion-spin { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .18); border-top-color: #fff; animation: appTransSpin .8s linear infinite; }
@keyframes appTransLogo { to { opacity: 1; transform: translateY(0); } }
@keyframes appTransText { to { opacity: 1; } }
@keyframes appTransSpin { to { transform: rotate(360deg); } }

/* Dashboard · tarjeta de lead entrante (demo) */
.dash-nuevolead { position: relative; overflow: hidden; border: 1px solid #111; border-radius: 18px; background: linear-gradient(135deg, #0f0f10 0%, #1c1c20 100%); color: #fff; padding: 1.35rem 1.5rem; margin-bottom: 1.5rem; opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.dash-nuevolead.is-in { opacity: 1; transform: translateY(0); }
.dash-nuevolead-head { display: flex; align-items: center; gap: .9rem; }
.dash-nuevolead-ping { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; flex: 0 0 auto; animation: dashPing 1.8s ease-in-out infinite; }
.dash-nuevolead-ping .app-ico { width: 22px; height: 22px; }
.dash-nuevolead-titles { flex: 1 1 auto; min-width: 0; }
.dash-nuevolead-eyebrow { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #9a9a9f; }
.dash-nuevolead-title { font-size: 1.15rem; margin: .1rem 0 0; }
.dash-nuevolead-badge { flex: 0 0 auto; font-size: .74rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.dash-nuevolead-body { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.25rem 0; }
.dash-nuevolead-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #9a9a9f; margin-bottom: .2rem; }
.dash-nuevolead-valor { font-weight: 600; }
.dash-nuevolead-foot { display: flex; justify-content: flex-end; }
.dash-nuevolead-foot .btn .app-ico { width: 16px; height: 16px; }
@keyframes dashPing { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .25); } 50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); } }
@media (max-width: 720px) { .dash-nuevolead-body { grid-template-columns: repeat(2, 1fr); } }

/* Dashboard · contador con salto y notificación */
.dash-stat-num.is-bump { animation: dashBump .6s cubic-bezier(.2, .9, .3, 1.4); color: #0f0f10; }
@keyframes dashBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.dash-noti { position: fixed; top: 1.1rem; right: 1.1rem; z-index: 1300; display: flex; align-items: center; gap: .8rem; max-width: 340px; background: #fff; border: 1px solid #ececec; border-radius: 14px; padding: .85rem 1rem; box-shadow: 0 16px 40px rgba(0, 0, 0, .16); transform: translateX(120%); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.dash-noti.is-in { transform: translateX(0); }
.dash-noti-ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: #0f0f10; color: #fff; flex: 0 0 auto; }
.dash-noti-ico .app-ico { width: 20px; height: 20px; }
.dash-noti-body { display: flex; flex-direction: column; line-height: 1.35; }
.dash-noti-body strong { font-size: .92rem; }
.dash-noti-body span { font-size: .82rem; color: #666; }
@media (max-width: 520px) { .dash-noti { left: 1.1rem; right: 1.1rem; max-width: none; } }

@media (prefers-reduced-motion: reduce) {
  .app-modal-overlay, .app-modal-dialog, .app-transicion, .app-transicion-logo,
  .app-transicion-text, .app-transicion-spin, .dash-nuevolead, .dash-nuevolead-ping,
  .dash-stat-num.is-bump, .dash-noti { transition: none !important; animation: none !important; }
  .app-transicion-logo, .app-transicion-text { opacity: 1; transform: none; }
}

button.app-acceso { width: 100%; text-align: left; font: inherit; background: transparent; cursor: pointer; }
