/* =========================================================
   LUNEXUS - Componentes (Design System, Light Mode)
   Todos los valores de marca (color, tipografía, espaciado,
   radios, sombras) viven en tokens.css — este archivo solo
   define CÓMO se ven los componentes usando esas variables.
   Sidebar oscuro (--lx-bg) + resto de la interfaz 100% clara
   (--lx-bg-light/--lx-surface). Inspirado en Linear, Notion,
   Vercel, ClickUp, HubSpot: minimalismo, bordes suaves, sombras
   muy sutiles, el color comunica estado (familia verde + un
   único rojo de excepción para urgencia).
   Selectores de ícono usan :where(i, svg) para funcionar tanto
   antes como después de que Lucide reemplace <i data-lucide> por
   el <svg> inline (lucide.createIcons(), ver assets/js/app.js).
   ========================================================= */

* {
    box-sizing: border-box;
}

/* Scroll suave para anclas internas (ej. "Tareas esta semana" del
   widget "Mi trabajo" del Dashboard → #lxAgenda). */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--lx-bg-light);
    color: var(--lx-text);
    font-family: var(--lx-font-body);
}

h1, h2, h3, h4, h5 {
    font-family: var(--lx-font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--lx-text);
}

/* h6 se usa en todo el sistema como "eyebrow" (etiqueta de sección
   pequeña, mayúscula, ej. "Últimos clientes registrados", "Progreso"),
   no como un titular real: tipografía de cuerpo con más tracking se
   lee mejor a ese tamaño que Poppins en negrita. */
h6 {
    font-family: var(--lx-font-body);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--lx-text);
}

p {
    line-height: 1.6;
}

.text-muted {
    color: var(--lx-text-muted) !important;
}

a {
    color: var(--lx-primary-hover);
    transition: color var(--lx-transition-fast);
}

a:hover {
    color: var(--lx-primary);
}

::selection {
    background-color: rgba(var(--lx-primary-rgb), 0.25);
    color: var(--lx-text);
}

/* Foco de teclado consistente y elegante en toda la interfaz */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.lx-filtro:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid rgba(var(--lx-primary-rgb), 0.55);
    outline-offset: 2px;
}

@keyframes lx-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lx-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes lx-skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

/* Scrollbar discreto, coherente con la marca (solo cosmético) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--lx-bg-light);
}

::-webkit-scrollbar-thumb {
    background-color: #C7C7C7;
    border-radius: var(--lx-radius-pill);
    border: 2px solid var(--lx-bg-light);
}

/* ---------- Marca (logotipo oficial, CLAUDE.md sección 11) ----------
   SVG real (assets/img/lunexus-logo-*-bg.svg), nítido en cualquier
   resolución/Retina por ser vectorial. Variante "dark-bg" para el
   sidebar oscuro; "light-bg" para las pantallas de autenticación
   (login/install/recuperar/restablecer), que muestran la marca sobre
   la card blanca, no sobre el fondo oscuro de <body>. */
.sidebar-brand-logo {
    /* Corrección "Logo del sidebar más grande" (a pedido explícito del
       dueño del proyecto): pidió el triple (84px), pero el wordmark es
       ancho (~3.25:1) y a esa altura se sale del panel de 260px —
       acordado el doble (56px) en su lugar, que sigue cabiendo con
       margen dentro de .sidebar-brand. */
    height: 56px;
    width: auto;
    display: block;
}

.lx-auth-logo {
    height: 34px;
    width: auto;
    display: inline-block;
}

/* ---------- Edición inline de texto (Clientes) ----------
   Mismo mecanismo de interacción que .lx-select-inline (Proyectos),
   aplicado a celdas de texto: assets/js/app.js::initEdicionInlineTexto(). */
.lx-editable-cell {
    cursor: text;
    border-radius: var(--lx-radius-xs);
    transition: background-color var(--lx-transition-fast);
}

.lx-editable-cell:hover {
    background-color: var(--lx-hover);
}

.lx-editable-cell .form-control {
    min-height: unset;
    padding: 0.3rem 0.6rem;
}

/* ---------- Resaltado de una tarea puntual (Dashboard → "Próximas
   Entregas" → proyecto.php?tab=tasks&tarea=Y). Aplica tanto a la fila de
   la vista Lista como a la tarjeta del Kanban: ver initResaltarTarea()
   en assets/js/tareas.js. ---- */
.lx-tarea-resaltada {
    background-color: var(--lx-primary-soft) !important;
    box-shadow: inset 0 0 0 2px var(--lx-primary);
    border-radius: var(--lx-radius-sm);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar (única superficie oscura del sistema) ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--lx-sidebar-width);
    background-color: var(--lx-bg);
    background-image: radial-gradient(circle at 20% 0%, rgba(var(--lx-primary-rgb), 0.10), transparent 55%);
    color: var(--lx-text-inverse);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 1030;
    box-shadow: 6px 0 32px -18px rgba(0, 0, 0, 0.45);
    transition: transform var(--lx-transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 0 0.25rem 1.5rem;
    border-bottom: 1px solid rgba(245, 247, 246, 0.1);
    margin-bottom: 1rem;
}

.sidebar-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(245, 247, 246, 0.68);
    padding: 0.65rem 0.75rem;
    border-radius: var(--lx-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
    transition: background-color var(--lx-transition-fast), color var(--lx-transition-fast), padding-left var(--lx-transition-fast);
}

.sidebar-nav .nav-link :where(i, svg) {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: color var(--lx-transition-fast);
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(245, 247, 246, 0.08);
    color: var(--lx-text-inverse);
    padding-left: 0.95rem;
}

.sidebar-nav .nav-link.active {
    background-color: var(--lx-primary-strong);
    color: var(--lx-text-inverse);
    font-weight: 600;
    box-shadow: 0 6px 16px -6px rgba(var(--lx-primary-rgb), 0.45);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 12, 0.5);
    z-index: 1020;
}

/* ---------- Main content ---------- */
.main-content {
    margin-left: var(--lx-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Topbar / Header (claro) ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--lx-border);
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.btn-toggle-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--lx-text);
    padding: 0.3rem;
}

.btn-toggle-sidebar :where(i, svg) {
    width: 22px;
    height: 22px;
}

.topbar-title {
    font-family: var(--lx-font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.topbar-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.topbar-search :where(i, svg) {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--lx-text-muted);
    pointer-events: none;
}

.topbar-search .form-control {
    padding-left: 2.25rem;
    border-radius: var(--lx-radius-sm);
    background-color: var(--lx-bg-light);
    border: 1px solid var(--lx-border);
    color: var(--lx-text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.btn-icon {
    position: relative;
    background: none;
    border: none;
    color: var(--lx-text-muted);
    padding: 0.45rem;
    border-radius: 50%;
    transition: background-color var(--lx-transition-fast), color var(--lx-transition-fast);
}

.btn-icon :where(i, svg) {
    width: 20px;
    height: 20px;
    display: block;
}

.btn-icon:hover {
    background-color: var(--lx-hover-strong);
    color: var(--lx-primary-hover);
}

.badge-dot {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 8px;
    height: 8px;
    background-color: var(--lx-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--lx-surface), 0 0 8px rgba(var(--lx-primary-rgb), 0.6);
}

/* Alerta en pantalla de la frase motivacional del día
   (includes/header.php) — .alert-success ya hereda el verde de marca
   vía --bs-success (tokens.css), sin ningún color nuevo. Flotante y
   centrada arriba de todo el contenido, por encima incluso de
   dropdowns abiertos (z-index), para que sea imposible no verla al
   entrar por primera vez en el día. */
.lx-alerta-frase-dia {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    width: min(92vw, 560px);
}

.lx-alerta-frase-dia .alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lx-alerta-frase-dia .alert > span {
    flex: 1 1 auto;
}

.lx-alerta-frase-dia .alert :where(i, svg) {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid transparent;
    padding: 0.3rem 0.6rem 0.3rem 0.3rem;
    border-radius: var(--lx-radius-pill);
    transition: background-color var(--lx-transition-fast), border-color var(--lx-transition-fast);
}

.btn-user:hover {
    background-color: var(--lx-hover-strong);
    border-color: var(--lx-border);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--lx-primary-strong);
    color: var(--lx-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--lx-font-heading);
    box-shadow: 0 0 0 2px var(--lx-surface), 0 0 0 3px rgba(var(--lx-primary-rgb), 0.3);
}

.user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--lx-text);
}

/* ---------- Color de usuario (selector en Usuarios, Agenda de Trabajo
   del Dashboard). Excepción acotada a identificación de persona: la
   paleta sale de Catalogs::userColorPalette(), nunca de --lx-primary. ---------- */
.lx-swatch-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lx-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: transform var(--lx-transition-fast), box-shadow var(--lx-transition-fast);
}

.lx-swatch:hover {
    transform: scale(1.12);
}

.lx-swatch.lx-swatch-selected {
    border-color: var(--lx-surface);
    box-shadow: 0 0 0 2px var(--lx-text);
}

.lx-swatch-sm {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* ---------- Breadcrumbs ---------- */
.lx-breadcrumb-bar {
    padding: 0.85rem 2rem 0;
}

.lx-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    color: var(--lx-text-muted);
}

.lx-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lx-breadcrumb a {
    color: var(--lx-text-muted);
    text-decoration: none;
    transition: color var(--lx-transition-fast);
}

.lx-breadcrumb a:hover {
    color: var(--lx-primary-hover);
}

.lx-breadcrumb li:last-child {
    color: var(--lx-text);
    font-weight: 500;
}

.lx-breadcrumb .lx-breadcrumb-sep {
    color: var(--lx-border);
    display: flex;
}

.lx-breadcrumb .lx-breadcrumb-sep :where(i, svg) {
    width: 13px;
    height: 13px;
}

/* ---------- Page content ---------- */
.page-content {
    flex: 1;
    padding: 1.5rem 2rem 2rem;
    animation: lx-fade-in 220ms ease;
}

/* ---------- Footer ---------- */
.app-footer {
    padding: 1rem 2rem;
    text-align: center;
    color: var(--lx-text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--lx-border);
}

/* ---------- Cards genéricas ---------- */
.lx-card {
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: 1.5rem;
    box-shadow: var(--lx-shadow);
    transition: border-color var(--lx-transition), box-shadow var(--lx-transition), transform var(--lx-transition);
}

.lx-card:hover {
    border-color: rgba(var(--lx-primary-rgb), 0.3);
    box-shadow: var(--lx-shadow-hover);
    transform: translateY(-1px);
}

/* ---------- Dashboard interactivo: KPIs y filas clickeables ----------
   Reutiliza .lx-card tal cual (mismo look, mismo hover) envuelta en un
   <a> en vez de un <div> — dashboard.php. */
a.lx-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.lx-card-link:hover {
    color: inherit;
}

/* Igual que .lx-card-link pero sobre <button> (dispara un modal en vez
   de navegar — widget "Mi trabajo" del Dashboard): mismo look que
   .lx-card, con el reset de estilos nativos de <button>. */
.lx-card-button {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

/* Indicador de estado de un widget del Dashboard (rediseño "Centro de
   Operaciones"): borde izquierdo, nunca un color nuevo — reutiliza
   exactamente los mismos tokens semánticos ya usados en toda la
   interfaz (--lx-primary-strong/--lx-primary-accent/--lx-danger, los
   mismos detrás de --bs-success/--bs-warning/--bs-danger en
   tokens.css). Se agrega SOBRE .lx-card, nunca lo reemplaza. */
.lx-card-estado-normal {
    border-left: 4px solid var(--lx-primary-strong);
}
.lx-card-estado-atencion {
    border-left: 4px solid var(--lx-primary-accent);
}
.lx-card-estado-critico {
    border-left: 4px solid var(--lx-danger);
}

/* Filas de lista clickeables (Próximas Entregas, Etapas del Proyecto). */
.lx-row-link {
    display: flex;
    color: inherit;
    text-decoration: none;
    border-radius: var(--lx-radius-xs);
    transition: background-color var(--lx-transition-fast);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.lx-row-link:hover {
    background-color: var(--lx-hover);
    color: inherit;
}

/* ---------- Agenda de Trabajo (Dashboard): grilla semanal real
   (domingo a sábado), estilo ClickUp/Linear/Notion Calendar. Una sola
   semana visible a la vez — "Esta semana"/"Próxima semana" reemplazan
   el contenido (assets/js/dashboard.js), no se ocultan con CSS. ---------- */
.lx-agenda {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.lx-agenda-dia {
    flex: 1 1 0;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.lx-agenda-dia-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4rem 0.6rem;
    border-radius: var(--lx-radius-sm);
    border: 1px solid var(--lx-border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--lx-text-muted);
}

.lx-agenda-dia-hoy .lx-agenda-dia-header {
    background-color: var(--lx-primary-soft);
    border-color: rgba(var(--lx-primary-rgb), 0.35);
    color: var(--lx-primary-hover);
}

.lx-agenda-dia-tareas {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 1.5rem;
}

.lx-agenda-tarea {
    display: block;
    /* background-color se fija inline por tarea (color_soft del
       responsable, con fallback a --lx-primary-soft — ver
       dashboard.php). border-left-color, igual, con color_primary. */
    background-color: var(--lx-bg-light);
    border-left: 3px solid var(--lx-primary);
    border-radius: var(--lx-radius-xs);
    padding: 0.35rem 0.5rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: filter var(--lx-transition-fast);
}

.lx-agenda-tarea:hover {
    /* filter en vez de background-color: el color de fondo se fija
       inline (mayor especificidad que cualquier clase), así que un
       :hover por clase no lo sobreescribiría. */
    filter: brightness(0.96);
}

/* Corrección de regresión ("Dashboard: expandir subtareas en la propia
   tarjeta"): la tarjeta ahora también lleva la clase .lx-agt-tarjeta
   (para reutilizar tal cual toggleExpandirTarjeta()/wireEventosChecklist(),
   que buscan esa clase — ver assets/js/dashboard.js). .lx-agt-tarjeta
   trae su propio padding/borde/sombra/animación pensados para las
   tarjetas, más grandes, de Agenda (14 columnas) — este selector de
   doble clase (mayor especificidad que cualquiera de las dos por
   separado, así que gana sin depender del orden en el archivo) restaura
   el aspecto compacto original de la grilla semanal del Dashboard;
   nunca se tocó .lx-agt-tarjeta en sí, que sigue igual para Agenda. */
.lx-agenda-tarea.lx-agt-tarjeta {
    display: block;
    padding: 0.35rem 0.5rem;
    border: none;
    border-left: 3px solid var(--lx-primary);
    border-radius: var(--lx-radius-xs);
    box-shadow: none;
    animation: none;
}

.lx-agenda-tarea.lx-agt-tarjeta:hover {
    box-shadow: none;
    transform: none;
}

/* .lx-agt-expandir (20x20 en Agenda) achicado acá al mismo criterio de
   escala compacta que .lx-agenda-completar-directa/.lx-agenda-tarea-vencimiento
   — la grilla semanal del Dashboard es más angosta que la de 14 días. */
.lx-agenda-tarea .lx-agt-expandir {
    width: 14px;
    height: 14px;
}

.lx-agenda-tarea .lx-agt-expandir i {
    width: 12px;
    height: 12px;
}

/* Progreso diario (Mejora "tablero diario"): reutiliza tal cual el
   componente de progreso de la Agenda (.lx-agt-progreso/.lx-agt-progreso-texto/
   .lx-agt-porcentaje, definidos más abajo en este archivo, sección
   "Agenda de Trabajo") — .lx-agenda-dia-progreso solo aporta el
   espaciado propio de esta columna, ninguna propiedad visual nueva
   (mismo color, misma altura de barra, mismo tamaño de texto). */
.lx-agenda-dia-progreso {
    margin-bottom: 0.15rem;
}

.lx-agenda-tarea-linea1 {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Completado directo de una tarea sin subtareas (mejora "Finalización
   de tareas sin subtareas") — mismo criterio de tamaño/color que el
   checkbox de subtarea de la Agenda (.lx-agt-subtarea input, más abajo
   en este archivo): nunca un componente nuevo. Su propio 'change'/'click'
   se maneja aparte en assets/js/dashboard.js, con guardas explícitas en
   initCompletarTareaSimpleDashboard()/initAgendaClicParaExpandir() para
   que no dispare también el expandir/contraer de la tarjeta. */
.lx-agenda-completar-directa {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: var(--lx-primary);
}

/* Indicador de vencimiento (Atrasada/En plazo) — un punto pequeño,
   nunca un fondo o borde agresivo (deliberadamente separado de
   border-left-color/background-color, que ya comunican el color del
   responsable con especificidad inline): mismos tokens de la paleta
   oficial que usa el resto del sistema para "urgente"/"vencida"
   (--lx-danger) y el verde de marca (--lx-primary) para "en plazo" —
   cero color inventado. */
.lx-agenda-tarea-vencimiento {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.lx-agenda-vencimiento-atrasada {
    background-color: var(--lx-danger);
}

.lx-agenda-vencimiento-en-plazo {
    background-color: var(--lx-primary);
}

/* "Máxima prioridad visual" pedida solo para Atrasada — el título en
   rojo es la única señal que puede ganarle a los estilos inline de la
   tarjeta sin !important (title/responsable no tienen color fijado
   inline, así que una regla de clase alcanza). */
.lx-agenda-tarea-atrasada .lx-agenda-tarea-titulo {
    color: var(--lx-danger);
}

.lx-agenda-tarea-titulo {
    display: block;
    /* flex:1 1 auto + min-width:0: ahora vive dentro de la fila flex
       .lx-agenda-tarea-linea1 (junto al punto de vencimiento) — sin
       esto, un flex-item no puede achicarse bajo su ancho de
       contenido y el text-overflow:ellipsis de abajo nunca se activa. */
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--lx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botón "Ver subtareas" (mejora "Dashboard: ver subtareas") — mismo
   criterio de tamaño/discreción que .lx-agenda-completar-directa:
   ícono pequeño, sin fondo ni borde propio, visible pero no compite
   con el título. Vive dentro del <a> (tarjeta completa es un enlace);
   su clic se maneja aparte con stopPropagation en
   initVerSubtareasDashboard() (assets/js/dashboard.js). */
.lx-agenda-tarea-responsable {
    display: block;
    font-size: 0.68rem;
    color: var(--lx-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lx-agenda-mas {
    border: none;
    background: none;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--lx-primary-hover);
    text-align: left;
    cursor: pointer;
}

.lx-agenda-mas:hover {
    text-decoration: underline;
}

/* Visible en todos los tamaños de pantalla: el cambio de semana ahora
   reemplaza contenido real (no es un ajuste solo-mobile). */
.lx-agenda-nav {
    display: flex;
    gap: 0.5rem;
}

.lx-card h5 {
    font-size: 1rem;
    letter-spacing: -0.005em;
}

/* Jerarquía de KPI: el número grande es el protagonista de la card,
   la etiqueta de arriba es un "eyebrow" pequeño con un ícono en chip
   circular a modo de micro-indicador (Dashboard, Facturación, Reportes). */
.lx-card .fs-3,
.lx-card .fs-4 {
    font-family: var(--lx-font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--lx-text);
}

.lx-card .text-muted.small.mb-1 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.lx-card .text-muted.small.mb-1 :where(i, svg) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background-color: var(--lx-primary-soft);
    color: var(--lx-primary-hover);
    padding: 0.35rem;
}

/* Bootstrap .card nativo: mismo tratamiento por si algún componente lo usa */
.card {
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    box-shadow: var(--lx-shadow);
}

/* ---------- Proyectos (toolbar + grid genérico, aún usado por
   Documentos y como base de .lx-filtro en Clientes/Proyectos/Leads) ---------- */
.proyectos-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.proyectos-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.proyectos-search {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 360px;
}

.proyectos-search :where(i, svg) {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--lx-text-muted);
    pointer-events: none;
}

.proyectos-search .form-control {
    padding-left: 2.25rem;
    border-radius: var(--lx-radius-sm);
}

.proyectos-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lx-filtro {
    border: 1px solid var(--lx-border);
    background-color: var(--lx-surface);
    color: var(--lx-text-muted);
    padding: 0.4rem 0.9rem;
    border-radius: var(--lx-radius-pill);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color var(--lx-transition-fast), color var(--lx-transition-fast), border-color var(--lx-transition-fast);
}

.lx-filtro:hover {
    background-color: var(--lx-hover-strong);
    color: var(--lx-text);
    border-color: rgba(var(--lx-primary-rgb), 0.3);
}

.lx-filtro.active {
    background-color: var(--lx-primary-strong);
    color: var(--lx-text-inverse);
    border-color: var(--lx-primary-strong);
    font-weight: 600;
}

.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.proyecto-card {
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--lx-shadow);
    transition: border-color var(--lx-transition), box-shadow var(--lx-transition), transform var(--lx-transition);
}

.proyecto-card:hover {
    border-color: rgba(var(--lx-primary-rgb), 0.3);
    box-shadow: var(--lx-shadow-hover);
    transform: translateY(-1px);
}

.proyecto-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.proyecto-tipo {
    font-size: 0.8rem;
    color: var(--lx-text-muted);
}

.proyecto-nombre {
    font-family: var(--lx-font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--lx-text);
}

.proyecto-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--lx-text-muted);
    margin-bottom: 1rem;
}

.proyecto-info :where(i, svg) {
    width: 15px;
    height: 15px;
    margin-right: 0.25rem;
    color: var(--lx-primary-hover);
    vertical-align: -2px;
}

.progress {
    height: 6px;
    border-radius: var(--lx-radius-pill);
    background-color: var(--lx-border);
}

.progress-bar {
    background-color: var(--lx-primary);
}

/* =========================================================
   Componentes Bootstrap: re-tematizados a la marca (sin tocar
   bootstrap.min.css ni el HTML). Mismas clases, mismo markup.
   ========================================================= */

/* ---------- Formularios ---------- */
.form-control,
.form-select {
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    color: var(--lx-text);
    border-radius: var(--lx-radius-sm);
    padding: 0.55rem 0.85rem;
    min-height: 42px;
    transition: border-color var(--lx-transition-fast), box-shadow var(--lx-transition-fast), background-color var(--lx-transition-fast);
}

textarea.form-control {
    min-height: unset;
}

.form-control::placeholder {
    color: var(--lx-text-muted);
    opacity: 0.75;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--lx-surface);
    border-color: var(--lx-primary);
    color: var(--lx-text);
    box-shadow: 0 0 0 0.2rem rgba(var(--lx-primary-rgb), 0.16);
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--lx-bg-light);
    color: var(--lx-text-muted);
}

.form-label {
    color: var(--lx-text);
    font-weight: 500;
    font-size: 0.85rem;
}

.form-check-input {
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
}

.form-check-input:checked {
    background-color: var(--lx-primary-strong);
    border-color: var(--lx-primary-strong);
}

.form-check-input:focus {
    border-color: var(--lx-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--lx-primary-rgb), 0.16);
}

.input-group-text {
    background-color: var(--lx-bg-light);
    border: 1px solid var(--lx-border);
    color: var(--lx-text-muted);
}

.invalid-feedback {
    color: var(--lx-danger);
    font-size: 0.8rem;
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--lx-danger);
}

.was-validated .form-control:invalid:focus,
.was-validated .form-select:invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--lx-danger-rgb), 0.18);
}

/* ---------- Botones ---------- */
.btn {
    border-radius: var(--lx-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    padding: 0.55rem 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background-color var(--lx-transition-fast), border-color var(--lx-transition-fast), color var(--lx-transition-fast), box-shadow var(--lx-transition-fast), transform var(--lx-transition-fast);
}

.btn :where(i, svg) {
    width: 15px;
    height: 15px;
}

.btn-sm {
    padding: 0.32rem 0.7rem;
    font-size: 0.8rem;
    border-radius: var(--lx-radius-xs);
}

.btn-sm :where(i, svg) {
    width: 13px;
    height: 13px;
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--lx-primary-rgb), 0.25);
}

.btn-primary {
    --bs-btn-bg: var(--lx-primary-strong);
    --bs-btn-border-color: var(--lx-primary-strong);
    --bs-btn-color: var(--lx-text-inverse);
    --bs-btn-hover-bg: var(--lx-primary-hover);
    --bs-btn-hover-border-color: var(--lx-primary-hover);
    --bs-btn-hover-color: var(--lx-text-inverse);
    --bs-btn-active-bg: var(--lx-primary-strong);
    --bs-btn-active-border-color: var(--lx-primary-strong);
    --bs-btn-active-color: var(--lx-text-inverse);
    --bs-btn-disabled-bg: var(--lx-border);
    --bs-btn-disabled-border-color: var(--lx-border);
    box-shadow: 0 4px 14px -6px rgba(var(--lx-primary-rgb), 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 18px -6px rgba(var(--lx-primary-rgb), 0.5);
}

.btn-secondary {
    --bs-btn-bg: var(--lx-bg-light);
    --bs-btn-border-color: var(--lx-border);
    --bs-btn-color: var(--lx-text);
    --bs-btn-hover-bg: var(--lx-hover-strong);
    --bs-btn-hover-border-color: var(--lx-border);
    --bs-btn-hover-color: var(--lx-text);
}

.btn-outline-secondary {
    --bs-btn-color: var(--lx-text-muted);
    --bs-btn-border-color: var(--lx-border);
    --bs-btn-hover-bg: var(--lx-hover-strong);
    --bs-btn-hover-border-color: var(--lx-border);
    --bs-btn-hover-color: var(--lx-text);
    --bs-btn-active-bg: var(--lx-hover-strong);
    --bs-btn-active-border-color: var(--lx-border);
    --bs-btn-active-color: var(--lx-text);
}

.btn-outline-primary {
    --bs-btn-color: var(--lx-primary-hover);
    --bs-btn-border-color: var(--lx-primary);
    --bs-btn-hover-bg: var(--lx-primary-strong);
    --bs-btn-hover-border-color: var(--lx-primary-strong);
    --bs-btn-hover-color: var(--lx-text-inverse);
    --bs-btn-active-bg: var(--lx-primary-strong);
    --bs-btn-active-border-color: var(--lx-primary-strong);
    --bs-btn-active-color: var(--lx-text-inverse);
}

.btn-outline-danger {
    --bs-btn-color: var(--lx-danger);
    --bs-btn-border-color: rgba(var(--lx-danger-rgb), 0.55);
    --bs-btn-hover-bg: var(--lx-danger);
    --bs-btn-hover-border-color: var(--lx-danger);
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-active-bg: var(--lx-danger);
    --bs-btn-active-border-color: var(--lx-danger);
}

.btn-outline-success {
    --bs-btn-color: var(--lx-primary-hover);
    --bs-btn-border-color: var(--lx-primary);
    --bs-btn-hover-bg: var(--lx-primary-strong);
    --bs-btn-hover-border-color: var(--lx-primary-strong);
    --bs-btn-hover-color: var(--lx-text-inverse);
}

.btn-outline-warning {
    --bs-btn-color: var(--lx-primary-hover);
    --bs-btn-border-color: var(--lx-primary-accent);
    --bs-btn-hover-bg: var(--lx-primary-accent);
    --bs-btn-hover-border-color: var(--lx-primary-accent);
    --bs-btn-hover-color: var(--lx-text);
}

/* Ghost: sin borde ni fondo hasta el hover — para acciones terciarias
   (no existe en Bootstrap por defecto, se agrega como utilidad propia). */
.btn-ghost {
    background-color: transparent;
    border: 1px solid transparent;
    color: var(--lx-text-muted);
}

.btn-ghost:hover {
    background-color: var(--lx-hover-strong);
    color: var(--lx-text);
}

.btn-close {
    opacity: 0.55;
}

.btn-close:hover {
    opacity: 0.85;
}

/* Estado de carga: se activa agregando la clase .is-loading al <button>
   desde JS justo antes del fetch() (ver assets/js/app.js). El texto
   original queda oculto y aparece un spinner centrado; no cambia nada
   de la lógica de envío del formulario. */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15px;
    height: 15px;
    margin: -7.5px 0 0 -7.5px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: lx-spin 600ms linear infinite;
}

.btn-outline-primary.is-loading::after,
.btn-outline-secondary.is-loading::after,
.btn-outline-danger.is-loading::after,
.btn-ghost.is-loading::after {
    border-color: rgba(var(--lx-primary-rgb), 0.3);
    border-top-color: var(--lx-primary-hover);
}

/* ---------- Badges (paleta de marca, nunca azul Bootstrap) ---------- */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--lx-radius-pill);
    padding: 0.38em 0.75em;
    line-height: 1.4;
}

/* Urgencia de fecha (widget "Próximas Entregas" del Dashboard):
   ATRASADA/HOY reutilizan .text-bg-danger (ya existe, cero clase
   nueva). MAÑANA es la única urgencia intermedia — usa el token
   --lx-warning (naranja), acotado a este caso puntual. */
.lx-badge-proximo {
    color: var(--lx-warning-text);
    background-color: var(--lx-warning-soft);
}

/* Estados de proyecto: Planificación=info, En desarrollo=primary,
   En revisión=warning, Pausado=secondary, Finalizado=success
   (ver app/Core/Catalogs.php::projectStates()). */
.text-bg-info {
    color: var(--lx-text) !important;
    background-color: var(--lx-bg-light) !important;
    border: 1px solid var(--lx-border);
}

.text-bg-primary {
    color: var(--lx-text-inverse) !important;
    background-color: var(--lx-primary-strong) !important;
}

.text-bg-warning {
    color: var(--lx-text) !important;
    background-color: var(--lx-primary-soft) !important;
    border: 1px solid rgba(var(--lx-primary-rgb), 0.25);
}

.text-bg-secondary {
    color: var(--lx-text) !important;
    background-color: var(--lx-bg-light) !important;
    border: 1px solid var(--lx-border);
}

.text-bg-success {
    color: #FFFFFF !important;
    background-color: var(--lx-primary) !important;
}

.text-bg-dark {
    color: var(--lx-text-inverse) !important;
    background-color: var(--lx-text) !important;
}

.text-bg-danger {
    color: var(--lx-danger) !important;
    background-color: var(--lx-danger-soft) !important;
}

.text-bg-light {
    color: var(--lx-text) !important;
    background-color: var(--lx-bg-light) !important;
    border: 1px solid var(--lx-border);
}

.badge.border {
    border-color: var(--lx-border) !important;
}

/* Utilidades de texto contextual (indicadores de margen/estado sueltos,
   fuera de un badge): mismo criterio de marca. */
.text-success {
    color: var(--lx-primary-hover) !important;
}

.text-danger {
    color: var(--lx-danger) !important;
}

.text-warning {
    color: var(--lx-primary-hover) !important;
}

.text-primary {
    color: var(--lx-primary-hover) !important;
}

.text-info {
    color: var(--lx-text-muted) !important;
}

.text-secondary {
    color: var(--lx-text-muted) !important;
}

.bg-light {
    background-color: var(--lx-bg-light) !important;
}

/* ---------- Edición rápida (inline) de Estado/Prioridad ----------
   <select> que se ve y se comporta como el badge de estado que
   reemplaza (mismo criterio de color por `data-color`, ver
   Catalogs::projectStates()/priorities()), pero editable en el
   listado de Proyectos sin abrir el modal (assets/js/proyectos.js). */
.lx-select-inline {
    min-height: unset;
    padding: 0.3rem 1.75rem 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--lx-radius-pill);
    cursor: pointer;
}

.lx-select-inline[data-color="primary"] {
    background-color: var(--lx-primary-strong);
    border-color: var(--lx-primary-strong);
    color: var(--lx-text-inverse);
}

.lx-select-inline[data-color="success"] {
    background-color: var(--lx-primary);
    border-color: var(--lx-primary);
    color: #FFFFFF;
}

.lx-select-inline[data-color="warning"] {
    background-color: var(--lx-primary-soft);
    border-color: rgba(var(--lx-primary-rgb), 0.25);
    color: var(--lx-text);
}

.lx-select-inline[data-color="danger"] {
    background-color: var(--lx-danger-soft);
    border-color: rgba(var(--lx-danger-rgb), 0.3);
    color: var(--lx-danger);
}

.lx-select-inline[data-color="info"],
.lx-select-inline[data-color="secondary"],
.lx-select-inline[data-color="dark"],
.lx-select-inline[data-color="light"] {
    background-color: var(--lx-bg-light);
    border-color: var(--lx-border);
    color: var(--lx-text);
}

.lx-select-inline:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ---------- Tablas ---------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--lx-text);
    --bs-table-border-color: var(--lx-border);
    --bs-table-hover-bg: var(--lx-hover);
    --bs-table-hover-color: var(--lx-text);
    border-collapse: separate;
    border-spacing: 0;
}

.table > thead {
    background-color: var(--lx-bg-light);
}

.table > thead > tr > th {
    color: var(--lx-text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    border-bottom: 1px solid var(--lx-border);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.table > tbody > tr {
    transition: background-color var(--lx-transition-fast);
}

.table > tbody > tr > td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    vertical-align: middle;
    border-bottom-color: var(--lx-border);
}

.table > tbody > tr:last-child > td {
    border-bottom: none;
}

.lx-th-ordenable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.lx-th-ordenable:hover {
    color: var(--lx-text);
}

.lx-th-ordenable .lx-sort-icon {
    width: 12px;
    height: 12px;
    opacity: 0.45;
    margin-left: 0.15rem;
    vertical-align: -1px;
}

.lx-th-ordenado-asc,
.lx-th-ordenado-desc {
    color: var(--lx-primary-hover);
}

.lx-th-ordenado-asc .lx-sort-icon,
.lx-th-ordenado-desc .lx-sort-icon {
    opacity: 1;
}

/* ---------- Modales ---------- */
.modal-content {
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    box-shadow: var(--lx-shadow-modal);
}

.modal-header {
    border-color: var(--lx-border);
    padding: 1.1rem 1.5rem;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-color: var(--lx-border);
    background-color: var(--lx-bg-light);
    padding: 1rem 1.5rem;
}

.modal-backdrop.show {
    opacity: 0.35;
    background-color: var(--lx-text);
}

/* ---------- Dropdowns ---------- */
.dropdown-menu {
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius-sm);
    box-shadow: var(--lx-shadow-modal);
    padding: 0.4rem;
    animation: lx-fade-in 150ms ease;
}

.dropdown-item {
    color: var(--lx-text);
    border-radius: var(--lx-radius-xs);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color var(--lx-transition-fast);
}

.dropdown-item :where(i, svg) {
    width: 15px;
    height: 15px;
    color: var(--lx-text-muted);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--lx-hover-strong);
    color: var(--lx-text);
}

.dropdown-header {
    color: var(--lx-text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 0.5rem 0.75rem 0.35rem;
}

/* =========================================================
   Agenda de Trabajo — Centro Operativo diario (documento de diseño
   "Agenda de Trabajo": tablero de planificación, no lista). Grilla FIJA
   de 14 días (nunca semanas de calendario, sin navegación), organizada
   en 2 filas de 7 columnas — una semana por fila, para que cada
   columna tenga espacio real — a propósito con un prefijo de clase
   distinto (.lx-agt-*) al de la Agenda del Dashboard (.lx-agenda-*):
   son estructuralmente distintas (tarjeta completa con checklist/menú
   de 3 puntos vs. tarjeta compacta de resumen) y conviven como
   familias hermanas, cada una con su propia densidad — pero desde la
   mejora UX "tablero diario" comparten el MISMO componente de barra de
   progreso (.lx-agt-progreso/.progress/.progress-bar, ver
   .lx-agenda-dia-progreso más abajo) y los mismos tokens de color para
   cualquier indicador de estado (--lx-danger/--lx-primary): la regla
   real nunca fue "cero clases en común", fue "nunca repintar a mano la
   misma información con un diseño distinto" — donde ambas pantallas
   muestran lo mismo (progreso, vencimiento), se ve igual. Diseño
   DEFINITIVO, construido 100% sobre los tokens de tokens.css — cero
   color/tipografía inventados.
   ========================================================= */
.lx-agenda-trabajo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    padding: 0.25rem 0 0.75rem;
}

/* Filtros "Ver: Todas / por responsable" + "Estado" — mismo .form-select
   ya retematizado del resto del sistema, solo se agrega el contenedor.
   flex-wrap: a partir de dos <select> + el toggle "Por día/Por proyecto"
   con ms-auto, la fila ya no entra en un viewport angosto (Tablet) sin
   wrap — el toggle simplemente baja a su propia línea, mismo criterio
   responsive que el resto de las toolbars de filtros del sistema. */
.lx-agt-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.lx-agt-filtros-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--lx-text-muted);
    margin-bottom: 0;
}

/* Mejora "Unificar Por Día y Por Proyecto": el filtro Período
   (#filtroPeriodoHistorialWrap) vive en un <span> propio para poder
   ocultarse/mostrarse como unidad (label + select) sin un contenedor
   con su propio layout — display:contents lo "disuelve" para que sus
   hijos sean flex items directos de .lx-agt-filtros, igual que
   cualquier otro <select> de la fila. Bootstrap .d-none (!important)
   sigue ganando cuando corresponde ocultarlo. */
.lx-agt-filtro-grupo {
    display: contents;
}

.lx-agt-semana-titulo {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lx-text-muted);
    margin-bottom: 0.6rem;
}

/* Mejora UX "Columnas ligeramente más anchas": de 155px a 210px —
   aparecen menos columnas a la vez en pantallas angostas, con scroll
   horizontal propio (overflow-x ya presente acá), a cambio de que cada
   tarjeta tenga espacio real para respirar. */
.lx-agt-semana-dias {
    display: grid;
    grid-template-columns: repeat(7, minmax(210px, 1fr));
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

/* Cada día es un panel independiente (documento: "debe sentirse como
   un panel independiente"), no solo una cabecera + tarjetas sueltas. */
.lx-agt-dia {
    display: flex;
    flex-direction: column;
    background-color: var(--lx-bg-light);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: 0.7rem;
    gap: 0.65rem;
    min-height: 100%;
}

.lx-agt-dia-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--lx-border);
}

.lx-agt-dia-nombre {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.lx-agt-dia-abrev {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lx-text-muted);
}

/* Jerarquía visual (documento: Día → Fecha → Cantidad → Tarjetas →
   Subtareas): el número de fecha es el elemento más grande de la
   cabecera, ancla visualmente la columna como en un calendario real. */
.lx-agt-dia-numero {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--lx-text);
    font-family: var(--lx-font-heading);
}

.lx-agt-dia-contador {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--lx-text-muted);
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius-pill);
    padding: 0.15rem 0.55rem;
    min-width: 1.6rem;
    text-align: center;
    align-self: flex-start;
}

.lx-agt-dia-hoy {
    background-color: var(--lx-primary-soft);
    border-color: rgba(var(--lx-primary-rgb), 0.3);
}

.lx-agt-dia-hoy .lx-agt-dia-header {
    border-bottom-color: rgba(var(--lx-primary-rgb), 0.25);
}

.lx-agt-dia-hoy .lx-agt-dia-abrev,
.lx-agt-dia-hoy .lx-agt-dia-numero {
    color: var(--lx-primary-hover);
}

.lx-agt-dia-tareas {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 3rem;
    border-radius: var(--lx-radius-sm);
    transition: background-color var(--lx-transition-fast);
}

/* Zona de "drop" activa durante un Drag & Drop en curso. */
.lx-agt-dia-tareas.lx-agt-dia-tareas-dragover {
    background-color: rgba(var(--lx-primary-rgb), 0.06);
    outline: 2px dashed rgba(var(--lx-primary-rgb), 0.4);
    outline-offset: 4px;
}

@keyframes lx-agt-tarjeta-entrada {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tarjeta real: sombra suave, bordes redondeados, padding generoso,
   hover con elevación + sombra más marcada, entrada suave. El color de
   urgencia siempre lo calcula PHP (includes/agenda_datos.php, único
   punto) — acá solo se traduce a un fondo MUY sutil + borde izquierdo,
   nunca un color fuerte de fondo completo. */
.lx-agt-tarjeta {
    display: flex;
    flex-direction: column;
    background-color: var(--lx-surface);
    border: 1px solid var(--lx-border);
    border-left: 3px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--lx-shadow);
    cursor: pointer;
    animation: lx-agt-tarjeta-entrada 180ms ease-out;
    transition: box-shadow 180ms ease, transform 180ms ease, border-color 150ms ease;
}

.lx-agt-tarjeta:hover {
    box-shadow: var(--lx-shadow-hover);
    transform: translateY(-2px);
}

.lx-agt-tarjeta.lx-agt-arrastrando {
    opacity: 0.5;
}

/* Mejora UX "Bordes de prioridad más sutiles": el color de urgencia
   queda EXCLUSIVAMENTE en la franja izquierda de 3px — antes también
   teñía todo el fondo de la tarjeta (background-color), lo que sumado
   al borde completo de 1px se leía como "demasiado color" con muchas
   tarjetas a la vista. Fondo siempre --lx-surface (blanco), sin
   importar la urgencia. */
.lx-agt-color-hoy {
    border-left-color: var(--lx-danger);
}

.lx-agt-color-manana {
    border-left-color: var(--lx-warning);
}

.lx-agt-color-reunion {
    border-left-color: var(--lx-primary);
}

/* Tareas sin ninguna urgencia asignada (ni hoy, ni mañana, ni reunión):
   --lx-gray (el único gris de la paleta, sección 12 de CLAUDE.md) como
   acento del borde izquierdo, para que se distingan de una tarjeta sin
   categoría en vez de quedar iguales a cualquier otra. */
.lx-agt-color-neutro {
    border-left-color: var(--lx-agt-neutro);
}

/* Mejora UX "Cabecera despejada": solo el ícono de desplegar + el
   título, inmediatamente al lado (completo, ver .lx-agt-titulo más
   abajo) — el resto de los controles (punto de responsable, menú ⋮,
   checkbox de completar, agregar subtarea, comentario) se movieron a
   .lx-agt-pie, al pie de la tarjeta. align-items:flex-start (no center):
   con el título pudiendo ocupar hasta 3 líneas, el ícono de desplegar
   debe quedar arriba, no centrado contra un bloque de texto alto. */
.lx-agt-cabecera {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.lx-agt-cabecera .lx-agt-titulo {
    flex: 1 1 auto;
    min-width: 0;
}

.lx-agt-cabecera .lx-agt-google-badge {
    flex: 0 0 auto;
}

.lx-agt-expandir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    color: var(--lx-text-muted);
    flex: 0 0 auto;
    cursor: pointer;
    transition: transform 200ms ease, background-color 150ms ease, color 150ms ease;
}

.lx-agt-expandir:hover {
    background-color: var(--lx-hover);
    color: var(--lx-text);
}

.lx-agt-expandir :where(i, svg) {
    width: 15px;
    height: 15px;
}

.lx-agt-tarjeta.lx-agt-expandida .lx-agt-expandir {
    transform: rotate(90deg);
}

/* Menú de 3 puntos (Ver / Agregar subtarea / Editar / Duplicar /
   Eliminar) — mismo tamaño que .lx-agt-expandir, empujado al extremo
   derecho de .lx-agt-pie (mejora UX "Barra de acciones inferior" — antes
   vivía en la cabecera). El dropdown en sí es Bootstrap estándar (mismo
   patrón que el menú de acciones de public/proyectos.php), sin CSS
   propio más allá del botón que lo abre. */
.lx-agt-menu {
    margin-left: auto;
    flex: 0 0 auto;
}

.lx-agt-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    color: var(--lx-text-muted);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.lx-agt-menu-btn:hover,
.lx-agt-menu-btn[aria-expanded="true"] {
    background-color: var(--lx-hover);
    color: var(--lx-text);
}

.lx-agt-menu-btn :where(i, svg) {
    width: 14px;
    height: 14px;
}

.lx-agt-punto {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 0 2px var(--lx-surface);
    /* El punto del responsable nunca cambia de color, sin importar el
       color de urgencia de la tarjeta que lo rodea. */
}

/* Mejora UX "Título hasta 2-3 líneas": antes una sola línea con
   ellipsis (el nombre quedaba cortado e ilegible) — line-clamp está
   pensado justo para esto, sin librería. .lx-agt-dia-unico-panel
   .lx-agt-titulo/.lx-agt-lista-col-tarea .lx-agt-titulo (más abajo en
   este archivo) siguen ganándole por especificidad en sus contextos
   (Vista del Día sin límite de líneas, Lista siempre 1 línea) — ambos
   agregan display:block explícito para no heredar el display:-webkit-box
   de acá. */
.lx-agt-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--lx-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mejora UX "Cabecera despejada": badges de contexto (Fecha/Proyecto),
   debajo de la cabecera (que ahora es solo ícono + título). Siempre
   presente en el DOM (aunque no tenga ningún badge esta tarea) — :empty
   lo oculta por CSS, así actualizarControlesSimpleAgenda() (agenda.js)
   siempre tiene un ancla estable donde insertar la barra de progreso al
   convertir una tarea simple en checklist. */
.lx-agt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.lx-agt-meta:empty {
    display: none;
    margin-bottom: 0;
}

/* Insignia de fecha — solo la vista "Por proyecto" del toggle la
   pinta (opciones.mostrarFecha en renderTarjetaAgendaTrabajo): ahí la
   columna ya no comunica el día, a diferencia de la vista Por día. */
.lx-agt-fecha-badge {
    flex: 0 0 auto;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--lx-text-muted);
    background-color: var(--lx-bg-light);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius-pill);
    padding: 0.1rem 0.5rem;
    white-space: nowrap;
}

/* Mejora "Agenda: nombre del Proyecto junto al menú ⋮" — antes solo
   Vista del Día, ahora también la grilla base de 14 columnas (mejora UX
   "Jerarquía visual", ver renderColumnaAgendaTrabajo()). Mismo criterio
   visual que .lx-agt-fecha-badge (píldora discreta), sin negrita, para
   no competir con el título de la tarea. */
.lx-agt-proyecto-badge {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--lx-text-muted);
    background-color: var(--lx-bg-light);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius-pill);
    padding: 0.1rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* La barra de progreso es la protagonista de la tarjeta (documento):
   ocupa casi todo el ancho, altura generosa, transición animada al
   cambiar. */
.lx-agt-progreso {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.lx-agt-progreso .progress {
    height: 8px;
    border-radius: var(--lx-radius-pill);
}

.lx-agt-progreso .progress-bar {
    transition: width 350ms ease;
    border-radius: var(--lx-radius-pill);
}

.lx-agt-progreso-texto {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.74rem;
    color: var(--lx-text-muted);
}

.lx-agt-porcentaje {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--lx-text);
}

/* Mejora UX "Barra de acciones inferior": todos los controles de la
   tarjeta (completar, agregar subtarea, comentario, responsable, menú ⋮)
   agrupados al pie, separados del contenido por una línea sutil —
   siempre presente (nunca se inserta/quita entero: solo el checkbox de
   completar directo entra/sale de acá, ver actualizarControlesSimpleAgenda()
   en agenda.js), así la tarjeta gana altura extra únicamente cuando el
   título ocupa más de una línea, nunca por controles sueltos. */
.lx-agt-pie {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--lx-border);
}

/* Botón de ícono genérico del pie (hoy solo "Agregar subtarea" — el
   comentario y el menú ⋮ ya traen su propio tamaño idéntico, ver
   .lx-agt-comentario-btn/.lx-agt-menu-btn más abajo/arriba). */
.lx-agt-pie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    color: var(--lx-text-muted);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color 150ms ease, color 150ms ease;
}

.lx-agt-pie-btn:hover {
    background-color: var(--lx-hover);
    color: var(--lx-text);
}

.lx-agt-pie-btn :where(i, svg) {
    width: 14px;
    height: 14px;
}

/* Checkbox de completar directo (tarea sin subtareas) — antes mostraba
   la palabra "Completar", ahora un ícono de check (pedido explícito:
   "en lugar de completar que salga el ícono de bien"), del mismo tamaño
   que el resto de los íconos del pie. */
.lx-agt-simple-check {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--lx-text-muted);
    cursor: pointer;
    margin: 0;
    flex: 0 0 auto;
}

.lx-agt-simple-check input[type="checkbox"] {
    cursor: pointer;
    /* 15px, no 14: coincide a propósito con .lx-agt-lista-check-espaciador
       (15x15) — la fila de "Lista" reutiliza esta misma clase y necesita
       que el checkbox y su espaciador midan exactamente igual para que
       la columna de Acciones no salte 1px al pasar de simple a
       compuesta. */
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--lx-primary);
}

.lx-agt-simple-check :where(i, svg) {
    width: 14px;
    height: 14px;
}

/* Mismo look que .lx-agt-agregar-subtarea (botón interno del
   checklist): dos clases distintas a propósito (selectores de eventos
   separados en agenda.js, ver initAccionesSimpleAgenda()), pero el
   mismo lenguaje visual — agrupadas en un solo bloque de reglas. */
.lx-agt-agregar-subtarea-tarjeta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    padding: 0.35rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--lx-primary-hover);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 150ms ease;
}

.lx-agt-agregar-subtarea-tarjeta:hover {
    background-color: var(--lx-primary-soft);
}

.lx-agt-agregar-subtarea-tarjeta :where(i, svg) {
    width: 14px;
    height: 14px;
}

/* Checklist integrado — nunca "contenido agregado debajo": mismo fondo,
   sin línea separadora dura, con una transición de altura + opacidad
   (CSS puro, sin medir alto por JS) al expandir/colapsar. */
.lx-agt-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 320ms ease, opacity 220ms ease, margin-top 320ms ease;
    cursor: default;
}

.lx-agt-tarjeta.lx-agt-expandida .lx-agt-checklist {
    max-height: 640px;
    opacity: 1;
    margin-top: 0.75rem;
}

.lx-agt-checklist-lista {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.lx-agt-subtarea {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.35rem;
    border-radius: var(--lx-radius-xs);
    /* transform: animación FLIP del reordenamiento al completar/
       descompletar (ver reordenarChecklistVisualmente() en agenda.js) —
       JS fija un transform inline "instantáneo" (transition: none) hacia
       la posición vieja y lo limpia un frame después; esta transición
       es la que realmente se ve, deslizando la fila hasta su posición
       nueva en vez de saltar de golpe. */
    transition: background-color 150ms ease, transform 220ms ease;
}

.lx-agt-subtarea:hover {
    background-color: var(--lx-hover);
}

.lx-agt-subtarea.lx-agt-arrastrando {
    opacity: 0.4;
}

.lx-agt-subtarea input[type="checkbox"] {
    flex: 0 0 auto;
    cursor: pointer;
    width: 15px;
    height: 15px;
    /* Checkbox moderno: tinte con el verde de marca en vez del azul por
       defecto del navegador — soporte nativo amplio, sin CSS a medida
       ni librería. */
    accent-color: var(--lx-primary);
}

.lx-agt-subtarea-texto {
    flex: 1 1 auto;
    font-size: 0.8rem;
    color: var(--lx-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 150ms ease;
}

.lx-agt-subtarea.lx-agt-completada .lx-agt-subtarea-texto {
    color: var(--lx-text-muted);
    text-decoration: line-through;
}

.lx-agt-subtarea-texto-input {
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--lx-primary);
    border-radius: var(--lx-radius-xs);
    min-height: auto;
}

.lx-agt-subtarea-acciones {
    display: flex;
    gap: 0.15rem;
    opacity: 0;
    transition: opacity 150ms ease;
    flex: 0 0 auto;
}

.lx-agt-subtarea:hover .lx-agt-subtarea-acciones {
    opacity: 1;
}

.lx-agt-subtarea-acciones button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    color: var(--lx-text-muted);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.lx-agt-subtarea-acciones button:hover {
    background-color: var(--lx-hover-strong);
    color: var(--lx-text);
}

.lx-agt-subtarea-acciones :where(i, svg) {
    width: 13px;
    height: 13px;
}

.lx-agt-agregar-subtarea {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    padding: 0.35rem 0.4rem;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--lx-primary-hover);
    cursor: pointer;
    text-align: left;
    transition: background-color 150ms ease;
}

.lx-agt-agregar-subtarea:hover {
    background-color: var(--lx-primary-soft);
}

.lx-agt-agregar-subtarea :where(i, svg) {
    width: 14px;
    height: 14px;
}

.lx-agt-subtarea-nueva-input {
    width: 100%;
    font-size: 0.8rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--lx-primary);
    border-radius: var(--lx-radius-xs);
    min-height: auto;
}

/* "Nueva tarea" — acción principal de ESTA pantalla, debe destacar más
   que un botón primario genérico. Acotado a .lx-agt-btn-nueva (no al
   id #btnNuevaTarea, que también usa el botón "Nueva Tarea" de la
   pestaña Tareas dentro de Proyecto — un selector por id en
   style.css, cargado en todo el sistema, le habría cambiado el
   aspecto a esa pantalla sin que se pidiera).
   Mejora UX "Botón flotante": position:fixed lo saca del flujo de
   .proyectos-header (que sigue reservando el layout de siempre para el
   título/subtítulo, ahora como único hijo real) — siempre visible,
   sin importar el scroll de la grilla de 14 días. z-index por debajo
   del sidebar/overlay (1030/1020) y de cualquier modal de Bootstrap
   (1055+), para que abrir #modalTarea u otro modal lo cubra con
   normalidad. */
.lx-agt-btn-nueva {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    z-index: 1000;
    padding: 0.75rem 1.4rem;
    border-radius: var(--lx-radius-pill);
    font-weight: 600;
    box-shadow: var(--lx-shadow-hover);
}

@media (max-width: 700px) {
    .lx-agt-btn-nueva {
        right: 1rem;
        bottom: 1rem;
    }
}

/* ---------- Vista "Lista" — listado plano de todas las tareas
   (rediseño "Listado plano + columna Proyecto") ----------
   Ya no son tarjetas ni hay agrupación por proyecto: un único panel
   (.lx-agt-lista-plana, mismo panel visual que .lx-agt-dia) contiene
   TODAS las filas, cada tarea es una FILA compacta (.lx-agt-fila-lista,
   ver assets/js/agenda.js::renderFilaListaAgendaTrabajo()) — no una
   tarjeta. Sigue siendo `.lx-agt-tarjeta` para heredar el checklist/
   menú de 3 puntos ya aprobados; las reglas de acá SOLO ajustan lo que
   cambia de layout (padding/sombra/cursor), nunca tocan
   `.lx-agt-tarjeta` en sí. */
.lx-agt-lista-plana {
    display: flex;
    flex-direction: column;
    background-color: var(--lx-bg-light);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    padding: 0.4rem 0.85rem 0.7rem;
    overflow-x: auto;
}

.lx-agt-lista-plana-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0;
}

.lx-agt-lista-plana-titulo {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--lx-text);
    font-family: var(--lx-font-heading);
}

/* .lx-agt-dia-tareas (compartida con "Por día", que sí necesita
   separación entre tarjetas) pierde el gap acá: las filas de la lista
   ya se separan con su propio border-bottom (.lx-agt-lista-fila), un
   gap encima se vería como doble espaciado. */
.lx-agt-lista-plana .lx-agt-dia-tareas {
    gap: 0;
    min-height: 0;
}

/* Cabecera de columnas + cada fila comparten exactamente la misma
   grilla — así quedan alineadas sin necesitar una tabla real. */
.lx-agt-lista-cabecera,
.lx-agt-lista-fila {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 160px 150px 130px 110px 100px 148px;
    column-gap: 0.75rem;
    align-items: center;
    min-width: 980px;
}

.lx-agt-lista-cabecera {
    padding: 0.5rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lx-text-muted);
}

/* Filas: ya no son tarjetas con sombra/hover-elevación — look de tabla
   moderna (fila + separador + hover sutil), coherente con el resto del
   Design System (Tablas, sección 12 CLAUDE.md). */
.lx-agt-fila-lista {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    cursor: default;
    animation: none;
}

.lx-agt-fila-lista:hover {
    box-shadow: none;
    transform: none;
}

.lx-agt-fila-lista .lx-agt-lista-fila {
    padding: 0.55rem 0.6rem;
    border-radius: var(--lx-radius-sm);
    border-bottom: 1px solid var(--lx-border);
    transition: background-color var(--lx-transition-fast);
}

.lx-agt-fila-lista:last-child .lx-agt-lista-fila {
    border-bottom: none;
}

.lx-agt-fila-lista:hover .lx-agt-lista-fila {
    background-color: var(--lx-hover);
}

/* .lx-agt-checklist normalmente hereda su inset del padding de
   .lx-agt-tarjeta (0.85rem 0.9rem) — acá esa clase quedó en 0 (arriba),
   así que el checklist necesita su propio padding horizontal para no
   quedar pegado a los bordes del panel al expandirse. */
.lx-agt-fila-lista .lx-agt-checklist {
    padding: 0 0.6rem;
}

.lx-agt-fila-lista.lx-agt-expandida .lx-agt-checklist {
    padding-bottom: 0.5rem;
}

/* Color de urgencia (hoy/mañana/reunión/neutro, Catalogs::colorTarjetaAgenda()):
   se conserva la misma información que en la tarjeta, ahora como un
   acento angosto a la izquierda de la fila en vez de un fondo
   completo — menos ruido en una lista densa. */
.lx-agt-fila-lista.lx-agt-color-hoy .lx-agt-lista-fila { border-left: 3px solid var(--lx-danger); }
.lx-agt-fila-lista.lx-agt-color-manana .lx-agt-lista-fila { border-left: 3px solid var(--lx-warning); }
.lx-agt-fila-lista.lx-agt-color-reunion .lx-agt-lista-fila { border-left: 3px solid var(--lx-primary); }
.lx-agt-fila-lista.lx-agt-color-neutro .lx-agt-lista-fila { border-left: 3px solid var(--lx-agt-neutro); }

.lx-agt-lista-col-tarea {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.lx-agt-lista-col-tarea .lx-agt-titulo {
    /* display:block reinicia el display:-webkit-box (line-clamp) de la
       regla base .lx-agt-titulo — "Lista" es una fila densa, siempre 1
       línea con ellipsis, sin cambios respecto al comportamiento previo
       a la mejora UX "Título hasta 2-3 líneas". */
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
}

/* Doble clic para renombrar (mejora "Lista editable Por Proyecto") —
   reemplaza al span tal cual, mismo criterio visual que
   .lx-agt-subtarea-texto-input. */
.lx-agt-titulo-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
}

/* ---------- Botón + panel de comentario rápido (rediseño "Listado
   plano + columna Proyecto") ----------
   Dropdown de Bootstrap reutilizado como popover pequeño — mismo
   componente que ya usa el menú de 3 puntos de la fila, sin introducir
   ningún patrón nuevo. */
.lx-agt-comentario {
    flex: 0 0 auto;
    display: inline-flex;
}

.lx-agt-comentario-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    color: var(--lx-text-muted);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.lx-agt-comentario-btn:hover,
.lx-agt-comentario-btn[aria-expanded="true"] {
    background-color: var(--lx-primary-soft);
    color: var(--lx-primary-hover);
}

.lx-agt-comentario-btn-activo {
    color: var(--lx-primary);
}

.lx-agt-comentario-btn :where(i, svg) {
    width: 14px;
    height: 14px;
}

/* Puntito de "esta tarea ya tiene comentario" — mismo .badge-dot que
   la campana de notificaciones (includes/header.php), reducido para
   caber en un botón de 22px en vez del ~34px del ícono del header. */
.lx-agt-comentario-dot {
    top: 1px;
    right: 1px;
    width: 6px;
    height: 6px;
    box-shadow: 0 0 0 1.5px var(--lx-bg-light);
}

.lx-agt-comentario-panel {
    width: 260px;
    padding: 0.5rem;
}

.lx-agt-comentario-textarea {
    resize: vertical;
    font-size: 0.82rem;
}

.lx-agt-lista-col-proyecto {
    min-width: 0;
}

.lx-agt-lista-proyecto-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    color: var(--lx-text);
    text-decoration: none;
}

.lx-agt-lista-proyecto-link:hover {
    color: var(--lx-primary-hover);
    text-decoration: underline;
}

/* Sin proyecto, mostrando el Cliente (mejora "Tareas asociadas al
   Cliente"): mismo enlace, tono ligeramente más apagado — comunica
   "esto es lo más cercano a un proyecto que tiene esta tarea", sin
   confundirlo visualmente con un proyecto real. */
.lx-agt-lista-proyecto-cliente {
    color: var(--lx-text-muted);
    font-style: italic;
}

.lx-agt-lista-col-responsable,
.lx-agt-lista-col-fecha {
    min-width: 0;
}

.lx-agt-lista-responsable,
.lx-agt-lista-fecha {
    width: 100%;
}

.lx-agt-lista-col-estado {
    min-width: 0;
}

.lx-agt-lista-progreso {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lx-agt-lista-progreso .progress {
    flex: 1 1 auto;
    height: 6px;
    border-radius: var(--lx-radius-pill);
}

.lx-agt-lista-progreso .lx-agt-porcentaje {
    flex: 0 0 auto;
    font-size: 0.74rem;
}

.lx-agt-lista-col-acciones {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.15rem;
}

.lx-agt-lista-check {
    margin: 0 0.2rem 0 0;
}

.lx-agt-lista-check-espaciador {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 0.2rem;
}

.lx-agt-lista-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: var(--lx-radius-xs);
    background: none;
    color: var(--lx-text-muted);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.lx-agt-lista-btn:hover {
    background-color: var(--lx-primary-soft);
    color: var(--lx-primary-hover);
}

.lx-agt-lista-btn-danger:hover {
    background-color: var(--lx-danger-soft);
    color: var(--lx-danger);
}

.lx-agt-lista-btn :where(i, svg) {
    width: 14px;
    height: 14px;
}

/* ---------- Vista del Día (drill-down de un solo día, ortogonal al
   toggle Por día/Lista — assets/js/agenda.js::renderVistaDiaUnico()/
   renderPanelGrupoUnicoAgenda()) ----------
   Exclusiva de "Por día": la vista Lista es un listado plano de por sí,
   sin drill-down propio ni cabecera clicable — .lx-agt-dia-header-clicable
   (botón "maximize-2") solo existe en las columnas de "Por día". */
.lx-agt-dia-header-clicable {
    cursor: pointer;
    border-radius: var(--lx-radius-sm);
    transition: background-color var(--lx-transition-fast);
}

.lx-agt-dia-header-clicable:hover {
    background-color: rgba(var(--lx-primary-rgb), 0.06);
}

.lx-agt-dia-header-acciones {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.lx-agt-dia-ver {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--lx-radius-sm);
    color: var(--lx-text-muted);
    cursor: pointer;
    transition: background-color var(--lx-transition-fast), color var(--lx-transition-fast);
}

.lx-agt-dia-ver:hover {
    background-color: var(--lx-surface);
    color: var(--lx-primary-hover);
}

.lx-agt-dia-ver :where(i, svg) {
    width: 13px;
    height: 13px;
}

/* Panel a todo el ancho (sin grid de 7 columnas ni el min-height:100%
   pensado para una fila de grid) con una lista VERTICAL de tarjetas —
   cada una ya ocupa el 100% del ancho por herencia de .lx-agt-dia-tareas
   (display:flex; flex-direction:column, sin align-items propio =
   stretch por defecto), así que solo hace falta relajar el
   truncamiento del título: acá SÍ hay espacio para leerlo completo. */
.lx-agt-dia-unico {
    display: flex;
    flex-direction: column;
}

.lx-agt-dia-unico-panel {
    width: 100%;
    min-height: auto;
    max-width: none;
}

.lx-agt-dia-unico-panel .lx-agt-titulo {
    /* display:block reinicia el display:-webkit-box (line-clamp) de la
       regla base .lx-agt-titulo — acá SÍ hay espacio para leerlo
       completo, sin límite de líneas (comportamiento sin cambios). */
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

/* ---------- Vista Compacta / Vista Detallada (mejora UX) ----------
   Detallada es el estado por defecto (reglas base de arriba, sin
   cambios). #lxAgendaTrabajoGrid.lx-agt-densidad-compacta (alternado por
   initDensidadAgenda(), assets/js/agenda.js) reduce padding/gaps/tamaño
   de fuente y el título vuelve a una sola línea — pensada para ver
   muchas tareas de un vistazo, exclusiva de "Por día" (Lista ya es
   compacta de por sí). Nunca toca el contador de la cabecera del día
   (.lx-agt-dia-contador) ni ningún dato, solo tamaños. ---------- */
.lx-agt-densidad-compacta .lx-agt-tarjeta {
    padding: 0.55rem 0.7rem;
}

.lx-agt-densidad-compacta .lx-agt-cabecera {
    margin-bottom: 0.3rem;
}

.lx-agt-densidad-compacta .lx-agt-titulo {
    font-size: 0.8rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.lx-agt-densidad-compacta .lx-agt-meta {
    display: none;
}

.lx-agt-densidad-compacta .lx-agt-progreso {
    gap: 0.2rem;
    margin-bottom: 0.3rem;
}

.lx-agt-densidad-compacta .lx-agt-pie {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
}

/* ---------- Hover enriquecido (mejora UX) ----------
   Contenido del popover (assets/js/agenda.js::construirContenidoPopoverAgenda()):
   filas rótulo/valor + descripción + subtareas. Mismos tokens de
   siempre — nada de color/tipografía nuevos fuera de tokens.css. ---------- */
.lx-agt-popover {
    max-width: 280px;
    border-color: var(--lx-border);
    box-shadow: var(--lx-shadow-modal);
}

.lx-agt-popover .popover-header {
    background-color: var(--lx-surface);
    border-bottom-color: var(--lx-border);
    font-family: var(--lx-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--lx-text);
}

.lx-agt-popover .popover-body {
    font-size: 0.78rem;
    color: var(--lx-text);
    padding: 0.65rem 0.8rem;
}

.lx-agt-popover-fila {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0;
}

.lx-agt-popover-label {
    color: var(--lx-text-muted);
    font-weight: 600;
}

.lx-agt-popover-descripcion {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--lx-border);
    color: var(--lx-text-muted);
    white-space: pre-line;
}

.lx-agt-popover-subtareas {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--lx-border);
}

.lx-agt-popover-subtarea {
    padding: 0.1rem 0;
    color: var(--lx-text-muted);
}

.lx-agt-popover-subtarea-completada {
    text-decoration: line-through;
    opacity: 0.7;
}

/* ---------- Responsive: Desktop / Notebook / Tablet ----------
   Las columnas nunca se "rompen" (ni se apilan en un grid desordenado
   ni se aplastan ilegibles): cada fila de semana sigue siendo 7
   columnas reales, con scroll horizontal propio de esa fila si el
   ancho disponible es menor a 7 × min-width — mismo criterio de
   tablero tipo calendario que Asana/ClickUp/Linear. */
@media (max-width: 992px) {
    .lx-agt-semana-dias {
        grid-template-columns: repeat(7, minmax(190px, 1fr));
    }
}

@media (max-width: 700px) {
    .lx-agt-dia-numero {
        font-size: 1.15rem;
    }
}

.dropdown-divider {
    border-color: var(--lx-border);
    margin: 0.4rem 0;
}

/* ---------- List group (checklist de Acuerdos en Reuniones) ----------
   Bootstrap define .list-group-item con variables LOCALES propias
   (--bs-list-group-bg/color/border-color) con valores de fábrica que no
   heredan de los --bs-* globales remapeados en tokens.css: hay que
   retintarlo explícitamente, es el único componente que lo necesita. */
.list-group-item {
    background-color: var(--lx-surface);
    color: var(--lx-text);
    border-color: var(--lx-border);
}

.list-group-flush > .list-group-item {
    border-width: 0 0 1px;
}

.list-group-flush > .list-group-item:last-child {
    border-bottom-width: 0;
}

/* ---------- Nav tabs (pestañas de Proyecto, estilo pill tipo
   Notion/ClickUp: fondo lleno en el tab activo, no solo un
   subrayado como el .nav-tabs clásico de Bootstrap) ---------- */
.nav-tabs {
    border-bottom: 1px solid var(--lx-border);
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-tabs .nav-link {
    color: var(--lx-text-muted);
    border: none;
    border-radius: var(--lx-radius-sm) var(--lx-radius-sm) 0 0;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: color var(--lx-transition-fast), background-color var(--lx-transition-fast);
}

.nav-tabs .nav-link :where(i, svg) {
    width: 15px;
    height: 15px;
}

.nav-tabs .nav-link:hover {
    color: var(--lx-text);
    background-color: var(--lx-hover);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--lx-primary-hover);
    background-color: var(--lx-primary-soft);
    border-color: transparent;
}

/* ---------- Paginación ---------- */
.pagination .page-link {
    background-color: var(--lx-surface);
    border-color: var(--lx-border);
    color: var(--lx-text-muted);
    margin: 0 0.15rem;
    border-radius: var(--lx-radius-xs);
}

.pagination .page-link:hover {
    background-color: var(--lx-hover-strong);
    color: var(--lx-text);
}

.pagination .page-item.active .page-link {
    background-color: var(--lx-primary-strong);
    border-color: var(--lx-primary-strong);
    color: var(--lx-text-inverse);
}

/* ---------- Alertas ---------- */
.alert {
    border-radius: var(--lx-radius-sm);
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--lx-primary-soft);
    border-color: rgba(var(--lx-primary-rgb), 0.3);
    color: #315421;
}

.alert-danger {
    background-color: var(--lx-danger-soft);
    border-color: rgba(var(--lx-danger-rgb), 0.3);
    color: #8A1F1F;
}

.alert-warning {
    background-color: rgba(var(--lx-primary-rgb), 0.1);
    border-color: rgba(var(--lx-primary-rgb), 0.25);
    color: #4A6E29;
}

/* ---------- Empty states ---------- */
.lx-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--lx-text-muted);
}

.lx-empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--lx-bg-light);
    color: var(--lx-text-muted);
    margin-bottom: 1rem;
}

.lx-empty-state-icon :where(i, svg) {
    width: 26px;
    height: 26px;
}

.lx-empty-state-title {
    font-family: var(--lx-font-heading);
    font-weight: 600;
    color: var(--lx-text);
    margin-bottom: 0.25rem;
}

.lx-empty-state-subtitle {
    font-size: 0.88rem;
    max-width: 360px;
}

/* ---------- Skeletons / Loading ----------
   Uso puntual: solo donde algo se carga de forma asíncrona real
   (ej. Chart.js vía CDN en Dashboard). No se fuerza en contenido
   que ya llega renderizado por PHP. */
.lx-skeleton {
    display: block;
    border-radius: var(--lx-radius-sm);
    background-color: var(--lx-border);
    animation: lx-skeleton-pulse 1.4s ease-in-out infinite;
}

/* ---------- Tooltips (Bootstrap nativo, inicializado en app.js) ---------- */
.tooltip .tooltip-inner {
    background-color: var(--lx-text);
    color: var(--lx-text-inverse);
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--lx-radius-xs);
}

.tooltip .tooltip-arrow::before {
    border-top-color: var(--lx-text);
}

.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--lx-text);
}

.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: var(--lx-text);
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .btn-toggle-sidebar {
        display: inline-flex;
    }

    .topbar-title {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .lx-breadcrumb-bar {
        padding: 0.75rem 1.25rem 0;
    }

    /* Móvil: una columna por día, apiladas verticalmente (en vez de
       franja horizontal) — la semana sigue siendo una sola, el cambio
       "Esta semana"/"Próxima semana" ya reemplaza contenido real a
       cualquier tamaño de pantalla (assets/js/dashboard.js). */
    .lx-agenda {
        flex-direction: column;
        overflow-x: visible;
    }

    .lx-agenda-dia {
        width: 100%;
        min-width: 0;
    }
}

/* ============================================================
   Cláusulas de un documento (Biblioteca Comercial, migración 062)
   — lista reordenable de includes/finance/biblioteca_clausulas.php
   (fuera de la ficha imprimible: eso usa .lx-doc-* en
   includes/_documento_chrome_impresion.php, sin relación con esto) y
   selector del modal "Agregar Cláusulas" (includes/_modal_clausula_documento.php).
   ============================================================ */

.lx-clausulas-documento {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lx-clausula-documento {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background-color: var(--lx-bg-light);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius, 10px);
    padding: 0.75rem 1rem;
}

.lx-clausula-documento.lx-clausula-documento-arrastrando {
    opacity: 0.5;
}

.lx-clausula-documento-drag {
    cursor: grab;
    color: var(--lx-text-muted);
    padding-top: 0.15rem;
}

.lx-clausula-documento-cuerpo {
    flex: 1 1 auto;
    min-width: 0;
}

.lx-clausula-documento-encabezado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.lx-clausula-documento-nombre {
    font-weight: 600;
}

.lx-clausula-documento-acciones {
    display: flex;
    gap: 0.25rem;
}

.lx-clausula-documento-contenido {
    font-size: 0.9rem;
    color: var(--lx-text);
    white-space: normal;
    cursor: text;
}

.lx-clausula-documento-textarea {
    font-size: 0.9rem;
}

.lx-clausula-seleccionable-lista {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 55vh;
    overflow-y: auto;
}

.lx-clausula-seleccionable {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius, 10px);
    padding: 0.6rem 0.85rem;
    cursor: pointer;
}

.lx-clausula-seleccionable:hover {
    border-color: var(--lx-primary);
}

.lx-clausula-seleccionable-cuerpo {
    flex: 1 1 auto;
    min-width: 0;
}

.lx-clausula-seleccionable-nombre {
    display: block;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.lx-clausula-seleccionable-preview {
    display: block;
    font-size: 0.82rem;
    color: var(--lx-text-muted);
}
.lx-editor-tarea {
    min-height: 110px;
    max-height: 360px;
    overflow-y: auto;
    white-space: normal;
}

.lx-editor-tarea:empty::before {
    content: attr(data-placeholder);
    color: var(--lx-text-muted);
    pointer-events: none;
}

.lx-editor-tarea img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: .75rem 0;
    border: 1px solid var(--lx-border);
    border-radius: 8px;
}

/* Solicitud de un Ticket (public/ticket.php, solo lectura) — mismo
   estilo de imagen que .lx-editor-tarea, sin las restricciones de
   altura/scroll pensadas para una caja editable. */
.lx-ticket-descripcion img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: .75rem 0;
    border: 1px solid var(--lx-border);
    border-radius: 8px;
}

/* Miniatura de la columna "Imagen" del listado de Tickets — abre
   #modalVistaPreviaTicket sin navegar al ticket. 144px = 4x el tamaño
   original (36px), a pedido explícito: reconocible de un vistazo en la
   lista, sin necesidad de hacer clic para verla. */
.lx-ticket-thumb-btn {
    display: inline-flex;
    width: 144px;
    height: 144px;
    padding: 0;
    overflow: hidden;
    border-radius: var(--lx-radius-sm, 6px);
}

.lx-ticket-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
