/* Lantawork · estilos del panel (todas las vistas). Sobre Bootstrap 5.3. Misma línea visual que Lantanalytic. */

:root {
    --lt-sidebar-w: 240px;
    --lt-topbar-h: 64px;
    --lt-bg: #f4f6f9;
    --lt-sidebar-bg: #111827;
    --lt-sidebar-fg: #9ca3af;
    --lt-accent: #4f46e5;
    --lt-border: #e5e7eb;
    --lt-muted: #6b7280;
    --bs-primary: var(--lt-accent);
    --bs-link-color: var(--lt-accent);
    --bs-link-hover-color: color-mix(in srgb, var(--lt-accent) 82%, #000);
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { font-size: .925rem; color: #1f2937; }
a { text-decoration: none; }
.btn-primary {
    --bs-btn-bg: var(--lt-accent); --bs-btn-border-color: var(--lt-accent);
    --bs-btn-hover-bg: color-mix(in srgb, var(--lt-accent) 85%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--lt-accent) 85%, #000);
    --bs-btn-active-bg: color-mix(in srgb, var(--lt-accent) 75%, #000); --bs-btn-active-border-color: color-mix(in srgb, var(--lt-accent) 75%, #000);
    --bs-btn-disabled-bg: var(--lt-accent); --bs-btn-disabled-border-color: var(--lt-accent);
}
.btn-outline-primary {
    --bs-btn-color: var(--lt-accent); --bs-btn-border-color: var(--lt-accent);
    --bs-btn-hover-bg: var(--lt-accent); --bs-btn-hover-border-color: var(--lt-accent);
    --bs-btn-active-bg: var(--lt-accent); --bs-btn-active-border-color: var(--lt-accent);
}
.btn-xs { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem; --bs-btn-border-radius: 6px; }
.form-check-input:checked { background-color: var(--lt-accent); border-color: var(--lt-accent); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: color-mix(in srgb, var(--lt-accent) 45%, #fff);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--lt-accent) 15%, transparent);
}
.form-label { font-weight: 500; font-size: .85rem; color: #374151; }
.dropdown-menu { --bs-dropdown-font-size: .9rem; border-color: var(--lt-border); box-shadow: 0 10px 30px rgba(17, 24, 39, .08); }
.dropdown-item.active, .dropdown-item:active { background: var(--lt-accent); }

/* ---------- Estructura (cabecera completa arriba, lateral debajo) ---------- */

.lt-body { background: var(--lt-bg); min-height: 100vh; }
.lt-topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--lt-topbar-h); z-index: 1045;
    display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem 0 0;
    background: #fff; border-bottom: 1px solid var(--lt-border);
}
.lt-brand {
    display: flex; align-items: center; gap: .6rem; width: var(--lt-sidebar-w); height: 100%; padding: 0 1.25rem; flex-shrink: 0;
    font-weight: 700; font-size: 1.05rem; color: #111827; text-decoration: none; letter-spacing: .01em; min-width: 0;
}
.lt-brand:hover { color: #111827; }
.lt-logo {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
    background: var(--lt-accent); color: #fff; font-size: 1rem; font-weight: 700;
}
.lt-logo-lg { width: 52px; height: 52px; border-radius: 12px; font-size: 1.5rem; }
/* Logo del proyecto (Configuración → General) */
.lt-logo-img { height: 38px; width: auto; max-width: 190px; object-fit: contain; flex-shrink: 0; }
.lt-logo-img.lt-logo-lg { height: 52px; max-width: 180px; }
.lt-logo-preview { width: 140px; height: 70px; border: 1px dashed #d1d5db; border-radius: 10px; display: grid; place-items: center; padding: .4rem; background: #fff; font-size: 1.6rem; }
.lt-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lt-menu-btn { border: 0; background: transparent; color: #6b7280; font-size: 1.6rem; line-height: 1; padding: .25rem; }
.lt-menu-btn:hover { color: #111827; }
.lt-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.lt-icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #6b7280;
    display: grid; place-items: center; font-size: 1.2rem; position: relative;
}
.lt-icon-btn:hover, .lt-icon-btn[aria-expanded="true"] { background: #f3f4f6; color: #111827; }
.lt-icon-btn .lt-count { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }
.lt-user { border: 0; background: transparent; display: flex; align-items: center; gap: .3rem; padding: .15rem .25rem; color: #6b7280; }
.lt-user::after { margin-left: .1rem; }
.lt-drop-panel { width: 320px; padding: 0; overflow: hidden; }
.lt-drop-head { padding: .75rem 1rem; font-weight: 600; border-bottom: 1px solid var(--lt-border); }
.lt-drop-empty { padding: 1.75rem 1rem; text-align: center; color: var(--lt-muted); font-size: .875rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.lt-drop-empty i { font-size: 1.6rem; opacity: .5; }

/* Buscador global */
.lt-search { position: relative; flex: 0 1 420px; min-width: 0; margin: 0; }
.lt-search > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.lt-search input {
    width: 100%; height: 38px; border: 1px solid var(--lt-border); background: #f9fafb; border-radius: 999px;
    padding: 0 1rem 0 2.4rem; font-size: .9rem; outline: none; transition: background .15s, border-color .15s;
}
.lt-search input:focus { background: #fff; border-color: color-mix(in srgb, var(--lt-accent) 45%, #fff); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--lt-accent) 12%, transparent); }
.lt-search-results { width: min(460px, 92vw); max-height: 70vh; overflow-y: auto; padding: .35rem 0; margin-top: .4rem; }
.lt-search-results.show { display: block; top: 100%; left: 0; }
.lt-search-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lt-muted); font-weight: 600; padding: .6rem 1rem .3rem; }
.lt-search-group i { color: var(--lt-accent); margin-right: .2rem; }
.lt-search-item { display: flex; flex-direction: column; padding: .45rem 1rem; color: #111827; text-decoration: none; }
.lt-search-item:hover, .lt-search-item.active { background: #f3f4f6; color: #111827; }
.lt-search-label { font-weight: 500; }
.lt-search-sub { font-size: .8rem; color: var(--lt-muted); }
.lt-search-empty { padding: 1rem; color: var(--lt-muted); font-size: .875rem; text-align: center; }

.lt-sidebar {
    position: fixed; top: var(--lt-topbar-h); bottom: 0; left: 0; width: var(--lt-sidebar-w); z-index: 1040;
    background: var(--lt-sidebar-bg); color: var(--lt-sidebar-fg); overflow-y: auto; transition: transform .2s ease;
    display: flex; flex-direction: column;
}
.lt-sidebar > .lt-nav { flex: 1 0 auto; }
/* Pie del menú: Lantalau, contacto y versión */
.lt-vendor { flex-shrink: 0; padding: .75rem 1.1rem .9rem; font-size: .7rem; }
.lt-vendor a { color: inherit; text-decoration: none; }
.lt-vendor-top { display: flex; align-items: center; gap: .6rem; }
.lt-vendor-logo img { display: block; width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); transition: transform .2s; }
.lt-vendor-logo:hover img { transform: rotate(-8deg) scale(1.06); }
.lt-vendor-links { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.lt-vendor-links a { display: flex; align-items: center; gap: .4rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lt-vendor-links a:hover { color: #fff; }
.lt-vendor-links i { color: #f97316; }
.lt-vendor-app { display: flex; flex-direction: column; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .65rem; line-height: 1.4; opacity: .65; }
.lt-vendor-app strong { color: #fff; }
.lt-page { margin-left: var(--lt-sidebar-w); padding-top: var(--lt-topbar-h); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; overflow-x: clip; }
.lt-content { padding: 1.5rem; flex: 1; width: 100%; min-width: 0; }
/* Menú plegado (escritorio): barra estrecha solo con iconos; al pasar el ratón se despliega por encima */
:root { --lt-sidebar-mini: 72px; }
@media (min-width: 992px) {
    body.lt-sidebar-closed .lt-page { margin-left: var(--lt-sidebar-mini); }
    body.lt-sidebar-closed .lt-brand { width: var(--lt-sidebar-mini); padding: 0; justify-content: center; }
    body.lt-sidebar-closed .lt-brand > span:last-child { display: none; }
    body.lt-sidebar-closed .lt-sidebar { width: var(--lt-sidebar-mini); overflow-x: hidden; transition: width .15s ease, box-shadow .15s; }
    body.lt-sidebar-closed .lt-sidebar .lt-nav { padding-left: .6rem; padding-right: .6rem; }
    body.lt-sidebar-closed .lt-sidebar .lt-nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
    body.lt-sidebar-closed .lt-sidebar .lt-nav-link > :not(i:first-child),
    body.lt-sidebar-closed .lt-sidebar .lt-nav-caret,
    body.lt-sidebar-closed .lt-sidebar .lt-nav-ext { display: none; }
    body.lt-sidebar-closed .lt-sidebar .lt-nav-section { font-size: 0; padding: .6rem 0; margin: .6rem .5rem; border-top: 1px solid rgba(255, 255, 255, .08); }
    body.lt-sidebar-closed .lt-sidebar .collapse.show { display: none; }
    body.lt-sidebar-closed .lt-vendor { padding: .5rem 0 .9rem; }
    body.lt-sidebar-closed .lt-vendor-top { justify-content: center; }
    body.lt-sidebar-closed .lt-vendor-links, body.lt-sidebar-closed .lt-vendor-app { display: none; }
    body.lt-sidebar-closed .lt-logo-img { max-width: calc(var(--lt-sidebar-mini) - 16px); }
}

.lt-nav { padding: 1rem .75rem 1.5rem; }
.lt-nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--lt-ic, #6b7280); padding: 1.25rem .75rem .5rem; }
.lt-nav-link {
    display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; margin-bottom: 2px;
    border-radius: 8px; color: var(--lt-sidebar-fg); text-decoration: none;
}
.lt-nav-link > i:first-child { font-size: 1.05rem; width: 1.2rem; text-align: center; color: var(--lt-ic, inherit); }
.lt-nav-link:hover { color: #e5e7eb; background: rgba(255, 255, 255, .05); }
.lt-nav-link.active { color: #fff; background: color-mix(in srgb, var(--lt-accent) 45%, transparent); }
.lt-nav-link.active-parent { color: #e5e7eb; }
.lt-nav-caret { margin-left: auto; font-size: .75rem; transition: transform .15s; }
.lt-nav-link.collapsed .lt-nav-caret { transform: rotate(-90deg); }
.lt-nav-sub { padding-left: 2.7rem; font-size: .88rem; }
.lt-nav-sub > i:first-child { font-size: .9rem; width: 1rem; }
.lt-nav-ext { margin-left: auto; font-size: .7rem; opacity: .6; }

/* Cabecera de la página (en el contenido) */
.lt-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.lt-page-head-title { display: flex; align-items: flex-start; gap: .75rem; min-width: 0; }
.lt-page-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lt-title { font-size: 1.35rem; font-weight: 600; margin: 0; min-width: 0; color: #111827; }
.lt-title small { font-weight: 400; color: var(--lt-muted); font-size: 1rem; margin-left: .35rem; }
.lt-back { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--lt-muted); background: #fff; border: 1px solid var(--lt-border); font-size: 1rem; }
.lt-back:hover { color: #111827; border-color: #d1d5db; }

.lt-backdrop { display: none; }
.lt-footer { display: flex; justify-content: space-between; padding: 1rem 1.5rem; font-size: .8rem; color: var(--lt-muted); }
.lt-impersonation {
    position: sticky; top: var(--lt-topbar-h); z-index: 1031; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
    background: #b45309; color: #fff; padding: .45rem 1.5rem; font-size: .875rem;
}

@media (max-width: 991.98px) {
    .lt-page { margin-left: 0; }
    .lt-sidebar { transform: translateX(-100%); }
    body.lt-sidebar-open .lt-sidebar { transform: none; }
    body.lt-sidebar-open .lt-backdrop { display: block; position: fixed; inset: var(--lt-topbar-h) 0 0 0; background: rgba(0, 0, 0, .4); z-index: 1035; }
    .lt-brand { width: auto; padding-right: 0; }
    .lt-brand > span:last-child { display: none; }
    .lt-content { padding: 1rem; }
    .lt-topbar { padding-right: .75rem; gap: .4rem; }
    .lt-filters .form-select { min-width: 0; flex: 1 1 140px; }
    div.dt-container div.dt-search input { min-width: 0; width: 100%; }
    .dt-container .dt-layout-row:first-child .dt-layout-start { width: 100%; }
    .dt-container .dt-search { flex: 1 1 100%; }
}
@media (max-width: 575.98px) {
    .lt-icon-btn { width: 34px; height: 34px; font-size: 1.05rem; }
    .lt-search input { padding-right: .5rem; }
}

/* ---------- Componentes ---------- */
.lt-card {
    display: block; background: #fff; color: inherit; border: 1px solid var(--lt-border); border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04); padding: 1.25rem;
}
a.lt-card:hover { border-color: color-mix(in srgb, var(--lt-accent) 40%, #fff); }
.lt-card-title { font-size: .95rem; font-weight: 600; margin-bottom: 1rem; color: #111827; }
.lt-card-title > i { color: var(--lt-accent); margin-right: .25rem; }
.lt-section-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lt-muted); font-weight: 600; margin: 1.5rem 0 .75rem; }
.lt-section-title:first-child { margin-top: 0; }

.lt-page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.lt-form-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; padding-top: 1rem; border-top: 1px solid var(--lt-border); margin-top: 1.25rem; }
.lt-sticky { position: sticky; top: calc(var(--lt-topbar-h) + 1rem); }

.lt-stat { display: flex; align-items: center; gap: 1rem; }
.lt-stat > i { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; background: #eef2ff; color: var(--lt-accent); }
.lt-stat-danger > i { background: #fef2f2; color: #b91c1c; }
.lt-stat-num { font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.lt-stat-label { color: var(--lt-muted); font-size: .825rem; }

/* Etiquetas */
.badge { font-weight: 500; }
.lt-badge {
    color: var(--lt-badge); background: color-mix(in srgb, var(--lt-badge) 12%, white);
    border: 1px solid color-mix(in srgb, var(--lt-badge) 28%, white); font-weight: 500;
}
.badge-soft-success { background: #ecfdf5; color: #047857; }
.badge-soft-secondary { background: #f3f4f6; color: #4b5563; }
.badge-soft-warning { background: #fffbeb; color: #b45309; }
.badge-soft-danger { background: #fef2f2; color: #b91c1c; }
.badge-soft-primary { background: #eef2ff; color: #4338ca; }
.lt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--lt-badge); }
.lt-code { font-family: var(--bs-font-monospace); font-size: .8rem; color: #be185d; }

/* ---------- Tablas ---------- */
.lt-dt thead th, .lt-table thead th, .lt-subtable thead th {
    font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--lt-muted);
    font-weight: 600; border-bottom-width: 1px; white-space: nowrap; background: transparent;
}
table.lt-dt tbody td, .lt-table tbody td { padding-top: .7rem; padding-bottom: .7rem; }
.lt-dt a.lt-row-title, .lt-link { font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.lt-col-icon { width: 34px; text-align: center; }
/* Todas las tablas con scroll horizontal propio: nunca ensanchan la página */
.dt-container { min-width: 0; }
.dt-container .dt-layout-table, .dt-container .dt-layout-table > * { min-width: 0; max-width: 100%; }
.dt-container .dt-layout-table > * { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.lt-dt td { white-space: nowrap; }
/* Alto ajustado a la pantalla (datatable.js → fitHeight): cabecera de la tabla fija al hacer scroll dentro */
@media (min-width: 992px) {
    .dt-container .dt-layout-table > * { overflow-y: auto; }
    table.lt-dt:not(.lt-dt-cards) thead th { position: sticky; top: 0; z-index: 2; background: #fff; box-shadow: inset 0 -1px 0 var(--lt-border); }
}
/* Paginador común: « ‹ 4 5 [selector] 7 8 › » */
.lt-pager { display: flex; align-items: center; gap: .25rem; flex-wrap: nowrap; }
.lt-pager-btn { min-width: 32px; height: 32px; padding: 0 .45rem; border: 1px solid var(--lt-border); background: #fff; color: var(--lt-accent); border-radius: 6px; }
.lt-pager-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--lt-accent) 8%, #fff); }
.lt-pager-btn:disabled { color: #c0c4cc; background: #fff; opacity: 1; }
.lt-pager-select { width: auto; min-width: 86px; height: 32px; font-weight: 600; color: var(--lt-accent); border-color: var(--lt-accent); }
@media (max-width: 575.98px) { .lt-pager-num { display: none; } }
table.lt-dt td.lt-wrap { white-space: normal; }
.lt-content, .lt-card, .tab-content, .modal-body { min-width: 0; }
.lt-page { min-width: 0; overflow-x: clip; }
.lt-row-actions { display: flex; gap: .3rem; flex-wrap: nowrap; margin-top: .35rem; visibility: hidden; }
tr:hover .lt-row-actions, tr:focus-within .lt-row-actions { visibility: visible; }
@media (hover: none) { .lt-row-actions { visibility: visible; } }
div.dt-container div.dt-search input { min-width: 240px; margin-left: 0 !important; }
div.dt-container .dt-paging .page-link { border-radius: 6px; margin: 0 2px; }
div.dt-container div.dt-processing { box-shadow: none; }
div.dt-container .pagination {
    --bs-pagination-active-bg: var(--lt-accent); --bs-pagination-active-border-color: var(--lt-accent); --bs-pagination-color: var(--lt-accent);
}
.dt-container .dt-layout-row:first-child .dt-layout-start { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.lt-filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.lt-filters .form-select { width: auto; min-width: 160px; }

/* ---------- Ficha ---------- */
.lt-tabs { padding: 0 .75rem; border-bottom: 1px solid var(--lt-border); flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.lt-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .9rem .9rem .8rem; white-space: nowrap; color: #4b5563; margin-bottom: -1px; }
.lt-tabs .nav-link i { color: var(--lt-muted); }
.lt-tabs .nav-link:hover { color: #111827; }
.lt-tabs .nav-link.active { color: #111827; font-weight: 600; border-bottom-color: var(--lt-accent); background: transparent; }
.lt-tabs .nav-link.active i { color: var(--lt-accent); }
.lt-tabs .badge { background: #f3f4f6; color: #4b5563; font-weight: 500; }
.lt-summary-links { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.lt-quick-contacts li { padding: .65rem 0; border-bottom: 1px solid var(--lt-border); font-size: .9rem; }
.lt-quick-contacts li:last-child { border-bottom: 0; padding-bottom: 0; }
.lt-quick-contacts li:first-child { padding-top: 0; }
.lt-quick-contacts a { display: inline-block; margin-right: .5rem; }
.lt-local { border: 1px solid var(--lt-border); border-radius: 10px; padding: .9rem 1rem; }
.lt-dl dt { font-weight: 500; color: var(--lt-muted); }
.lt-dl dd { margin-bottom: .7rem; }
.lt-timeline { list-style: none; padding: 0; margin: 0; }
.lt-timeline > li { position: relative; padding: 0 0 1rem 1.25rem; }
.lt-timeline > li::before { content: ''; position: absolute; left: .25rem; top: .45rem; bottom: 0; border-left: 1px solid var(--bs-border-color); }
.lt-timeline > li::after { content: ''; position: absolute; left: 0; top: .3rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--lt-accent); }
.lt-timeline > li:last-child::before { display: none; }
.lt-upload { background: #f9fafb; border: 1px dashed var(--lt-border); border-radius: 10px; padding: .75rem; margin-left: 0; margin-right: 0; }

/* ---------- Mapas ---------- */
.lt-map { height: 300px; background: #e9ecef; }
.lt-map-sm { height: 220px; }
.lt-map-edit { border-radius: 10px; border: 1px solid var(--lt-border); cursor: crosshair; }

/* ---------- Superadmin ---------- */
.lt-matrix th { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--lt-muted); font-weight: 600; white-space: nowrap; }
.lt-matrix tr.lt-off td:not(:first-child):not(:nth-child(2)) { opacity: .35; }
.lt-menu-tree { list-style: none; padding: 0; margin: 0; }
.lt-menu-tree > li { border: 1px solid var(--lt-border); border-radius: 10px; margin-bottom: .5rem; background: #fff; }
.lt-menu-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .85rem; }
.lt-menu-row .lt-menu-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #f3f4f6; color: var(--lt-ic, #374151); flex-shrink: 0; }
.lt-menu-children { list-style: none; margin: 0; padding: 0 0 .4rem 2.6rem; }
.lt-menu-children .lt-menu-row { padding: .35rem .85rem; border-top: 1px dashed var(--lt-border); }
.lt-menu-section { background: #f9fafb !important; }
.lt-off-item { opacity: .5; }
.lt-icon-preview { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: #f3f4f6; font-size: 1.15rem; color: var(--lt-ic, #374151); }
.lt-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; max-height: 170px; overflow-y: auto; padding: 4px; border: 1px solid var(--lt-border); border-radius: 8px; }
.lt-icon-grid button { border: 1px solid transparent; background: #fff; border-radius: 6px; height: 36px; font-size: 1.05rem; color: #374151; }
.lt-icon-grid button:hover, .lt-icon-grid button.active { border-color: var(--lt-accent); color: var(--lt-accent); background: #eef2ff; }

/* ---------- Acceso ---------- */
.lt-auth { background: var(--lt-sidebar-bg); min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.lt-auth-box { width: 100%; max-width: 400px; }
.lt-auth-box:has(.lt-install) { max-width: 720px; }
.lt-auth .lt-card { border: 0; border-radius: 14px; padding: 1.75rem; }
.lt-auth-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; color: #fff; font-weight: 600; font-size: 1.35rem; margin-bottom: 1.25rem; }

/* Diálogo común por encima de todo */
#lt-dialog { z-index: 1095; }

/* ---------- Personas (avatar + nombre + puesto) ---------- */
.lt-av {
    width: var(--lt-av-size, 36px); height: var(--lt-av-size, 36px); border-radius: 50%; flex-shrink: 0; object-fit: cover;
    display: inline-grid; place-items: center; vertical-align: middle; background: #e5e7eb;
}
.lt-av-initials { background: var(--lt-av-bg, #4f46e5); color: #fff; font-weight: 600; font-size: calc(var(--lt-av-size, 36px) * .38); letter-spacing: .02em; }
.lt-person { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; max-width: 100%; vertical-align: middle; }
.lt-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.lt-person-name { font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.lt-person-name:hover { color: var(--lt-accent); }
.lt-person-sub { font-size: .8rem; color: var(--lt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-people { list-style: none; margin: 0; padding: 0 0 .5rem; }
.lt-people > li { padding: .6rem 1rem; }
.lt-people > li:nth-child(odd) { background: #f9fafb; }
.lt-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--lt-accent); color: #fff; font-weight: 600; font-size: .8rem; }
.lt-avatar-lg { width: 36px; height: 36px; }

/* Listado en tarjetas (DataTable con view('cards')).
   En escritorio sigue siendo una tabla (sin cabecera): cada dato queda en su columna, alineado fila a fila.
   En móvil cada fila se convierte en una tarjeta con los datos uno debajo de otro. */
table.lt-dt-cards { border-top: 0; }
table.lt-dt-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
table.lt-dt-cards tbody td {
    --bs-table-bg: transparent; --bs-table-accent-bg: transparent; --bs-table-bg-state: transparent;
    background: transparent !important; box-shadow: none !important;
    padding: .85rem .75rem; border-bottom: 1px solid var(--lt-border);
}
table.lt-dt-cards tbody tr:nth-child(odd) { background: #f9fafb; }
table.lt-dt-cards tbody tr:hover { background: color-mix(in srgb, var(--lt-accent) 5%, #fff); }
table.lt-dt-cards tbody td.dt-empty { text-align: center; color: var(--lt-muted); }
@media (max-width: 991.98px) {
    /* Móvil: ⋮ a la izquierda y los datos uno debajo de otro en una sola columna */
    table.lt-dt-cards, table.lt-dt-cards tbody { display: block; width: 100% !important; }
    table.lt-dt-cards tbody tr { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: .4rem; row-gap: .35rem; align-items: center; padding: .85rem .75rem .85rem .25rem; border-bottom: 1px solid var(--lt-border); }
    table.lt-dt-cards tbody tr:not(:has(> td.lt-col-actions)) { grid-template-columns: minmax(0, 1fr); padding-left: .75rem; }
    table.lt-dt-cards tbody td { border: 0; padding: 0; white-space: normal; grid-column: -2; min-width: 0; }
    table.lt-dt-cards tbody td.lt-col-actions { grid-column: 1; grid-row: 1; width: auto; }
    table.lt-dt-cards tbody td.dt-empty { grid-column: 1 / -1; }
    table.lt-dt-cards tbody td:empty { display: none; }
}

/* Acciones de registro (Ui\RowActions): ⋮ con desplegable; en móvil, panel desde abajo */
.lt-col-actions { width: 44px; padding-left: .25rem !important; padding-right: 0 !important; text-align: center; }
.lt-actions { display: inline-block; }
.lt-kebab { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--lt-muted); font-size: 1.1rem; line-height: 1; }
.lt-kebab:hover, .lt-kebab[aria-expanded="true"] { background: #eef0f4; color: #111827; }
.lt-kebab:focus-visible { outline: 2px solid var(--lt-accent); outline-offset: 1px; }
.lt-kebab.is-circle { width: 34px; height: 34px; border: 1px solid var(--lt-border); background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.lt-kebab.is-circle:hover, .lt-kebab.is-circle[aria-expanded="true"] { border-color: color-mix(in srgb, var(--lt-accent) 45%, #fff); color: var(--lt-accent); background: #fff; }
.lt-actions-menu { min-width: 190px; padding: .35rem; font-size: .9rem; z-index: 1090; }
.lt-actions-menu form { margin: 0; }
.lt-actions-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; border-radius: 6px; padding: .45rem .7rem; }
.lt-actions-menu .dropdown-item i { width: 1.1rem; text-align: center; color: var(--lt-muted); }
.lt-actions-menu .dropdown-item.text-danger i { color: inherit; }
.lt-actions-menu .dropdown-item.text-danger:hover { background: #fef2f2; }
.lt-actions-head { display: none; }
@media (max-width: 575.98px) {
    .lt-actions-menu.show {
        position: fixed !important; inset: auto 0 0 0 !important; transform: none !important; margin: 0 !important;
        width: 100%; max-height: 70vh; overflow-y: auto; border: 0; border-radius: 1rem 1rem 0 0;
        padding: .5rem .75rem calc(.75rem + env(safe-area-inset-bottom)); font-size: 1rem;
        box-shadow: 0 0 0 100vmax rgba(17, 24, 39, .45); /* fondo oscuro detrás del panel */
    }
    .lt-actions-head { display: block; padding: .6rem .75rem .7rem; font-weight: 600; text-align: center; border-bottom: 1px solid var(--lt-border); margin-bottom: .35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lt-actions-head::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #d1d5db; margin: 0 auto .6rem; }
    .lt-actions-menu .dropdown-item { padding: .8rem .75rem; }
}

/* Ficha de perfil */
.lt-profile-card .lt-profile-stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--lt-border); border-bottom: 1px solid var(--lt-border); }
.lt-profile-stats > div { padding: .85rem .5rem; text-align: center; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.lt-profile-stats > div + div { border-left: 1px solid var(--lt-border); }
.lt-profile-stats strong { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-profile-stats span { font-size: .8rem; color: var(--lt-muted); }
.lt-profile-links { list-style: none; margin: 0; padding: .75rem 1rem; }
.lt-profile-links li { display: flex; gap: .65rem; align-items: flex-start; padding: .35rem 0; font-size: .9rem; min-width: 0; }
.lt-profile-links li > i { color: #9ca3af; margin-top: .1rem; }
.lt-profile-links a { overflow: hidden; text-overflow: ellipsis; }

/* Selector de opción con tarjeta (radio) */
.lt-choice input { position: absolute; opacity: 0; }
.lt-choice span { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border: 1px solid var(--lt-border); border-radius: 8px; cursor: pointer; background: #fff; }
.lt-choice input:checked + span { border-color: var(--lt-accent); background: color-mix(in srgb, var(--lt-accent) 8%, #fff); color: var(--lt-accent); font-weight: 500; }
.lt-choice input:focus-visible + span { outline: 2px solid var(--lt-accent); outline-offset: 2px; }

/* ===== Mensajes (plantilla de chat reutilizable) ===== */
.lt-drop-list { max-height: 360px; overflow-y: auto; }
.lt-drop-foot { display: block; padding: .6rem 1rem; text-align: center; border-top: 1px solid var(--lt-border); font-size: .85rem; font-weight: 600; text-decoration: none; }
.lt-chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - var(--lt-topbar-h) - 9rem); min-height: 420px; background: #fff; border: 1px solid var(--lt-border); border-radius: .75rem; overflow: hidden; }
.lt-chat.has-aside { grid-template-columns: 300px minmax(0, 1fr) 260px; }
.lt-chat-list { display: flex; flex-direction: column; border-right: 1px solid var(--lt-border); min-height: 0; }
.lt-chat-list-head { padding: .75rem; border-bottom: 1px solid var(--lt-border); }
.lt-chat-items { flex: 1; overflow-y: auto; }
.lt-chat-filter { position: relative; }
.lt-chat-filter > i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--lt-muted); font-size: .85rem; }
.lt-chat-filter .form-control { padding-left: 2rem; }
.lt-chat-item { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; color: inherit; text-decoration: none; border-bottom: 1px solid #f3f4f6; position: relative; }
.lt-chat-item:hover { background: #f9fafb; color: inherit; }
.lt-chat-item.active { background: color-mix(in srgb, var(--lt-accent) 9%, #fff); box-shadow: inset 3px 0 0 var(--lt-accent); }
.lt-chat-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lt-chat-item-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .875rem; }
.lt-chat-item-top strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-chat-item-top time { font-size: .72rem; color: var(--lt-muted); flex-shrink: 0; }
.lt-chat-item-body { font-size: .8rem; color: var(--lt-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-chat-item.is-unread .lt-chat-item-body { color: #111827; font-weight: 600; }
.lt-chat-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--lt-accent); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.lt-chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lt-chat-head { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--lt-border); }
.lt-chat-messages { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; background: #f8fafc; display: flex; flex-direction: column; gap: .4rem; }
.lt-chat-start, .lt-chat-empty { margin: auto; text-align: center; color: var(--lt-muted); font-size: .9rem; }
.lt-chat-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem; }
.lt-chat-empty i { font-size: 2.5rem; opacity: .4; }
.lt-msg-day { text-align: center; margin: .6rem 0 .3rem; }
.lt-msg-day span { font-size: .72rem; color: var(--lt-muted); background: #e5e7eb; border-radius: 1rem; padding: .15rem .7rem; }
.lt-msg { display: flex; align-items: flex-end; gap: .5rem; max-width: 78%; }
.lt-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.lt-msg-bubble { background: #fff; border: 1px solid var(--lt-border); border-radius: 1rem 1rem 1rem .3rem; padding: .5rem .8rem; min-width: 0; }
.lt-msg.is-mine .lt-msg-bubble { background: var(--lt-accent); border-color: var(--lt-accent); color: #fff; border-radius: 1rem 1rem .3rem 1rem; }
.lt-msg-body { font-size: .9rem; overflow-wrap: anywhere; }
.lt-msg.is-mine .lt-msg-body a { color: #fff; text-decoration: underline; }
.lt-msg-bubble time { display: block; text-align: right; font-size: .68rem; opacity: .65; margin-top: .15rem; }
.lt-chat-compose { display: flex; align-items: flex-end; gap: .5rem; padding: .75rem; border-top: 1px solid var(--lt-border); }
.lt-chat-compose textarea { resize: none; max-height: 160px; }
.lt-chat-aside { border-left: 1px solid var(--lt-border); overflow-y: auto; }
.lt-people-pick { max-height: 60vh; overflow-y: auto; margin: 0 -1rem; }
.lt-people-pick .lt-chat-item { padding-left: 1rem; padding-right: 1rem; }
@media (max-width: 1399.98px) {
    .lt-chat.has-aside { grid-template-columns: 300px minmax(0, 1fr); }
    .lt-chat-aside { display: none; }
}
@media (max-width: 991.98px) {
    .lt-chat, .lt-chat.has-aside { grid-template-columns: 1fr; height: calc(100vh - var(--lt-topbar-h) - 7rem); }
    .lt-chat.is-open .lt-chat-list { display: none; }
    .lt-chat:not(.is-open) .lt-chat-main { display: none; }
    .lt-chat-list { border-right: 0; }
    .lt-msg { max-width: 90%; }
}

/* ===== Campo «relación» (Ui\Form::relation) ===== */
.lt-rel { position: relative; display: flex; gap: .5rem; align-items: flex-start; }
.lt-rel-box { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-height: 38px; padding: .25rem .4rem; cursor: text; }
.lt-rel-box:focus-within { border-color: color-mix(in srgb, var(--lt-accent) 50%, #fff); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--lt-accent) 15%, transparent); }
.lt-rel-chips { display: contents; }
.lt-rel-input { flex: 1; min-width: 140px; border: 0; outline: 0; padding: .2rem .25rem; background: transparent; }
.lt-rel:not([data-rel-multiple]) .lt-rel-chips:not(:empty) + .lt-rel-input { display: none; }
.lt-rel-chip { display: inline-flex; align-items: center; gap: .15rem; max-width: 100%; background: #f1f3f7; border: 1px solid var(--lt-border); border-radius: 2rem; padding: .1rem .15rem .1rem .25rem; }
.lt-rel:not([data-rel-multiple]) .lt-rel-chip { background: transparent; border-color: transparent; padding-left: .1rem; }
.lt-rel-open { color: inherit; text-decoration: none; min-width: 0; }
.lt-rel-open:hover .lt-rel-label { color: var(--lt-accent); text-decoration: underline; }
.lt-rel-item { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.lt-rel-item .lt-av { flex-shrink: 0; }
.lt-rel-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.lt-rel-label { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-rel-text small { font-size: .74rem; color: var(--lt-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-rel-chip .lt-rel-text small { display: none; }
.lt-rel:not([data-rel-multiple]) .lt-rel-chip .lt-rel-text small { display: block; }
.lt-rel-x { border: 0; background: transparent; color: var(--lt-muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.lt-rel-x:hover { background: #e5e7eb; color: #111827; }
.lt-rel-new { flex-shrink: 0; height: 38px; }
.lt-rel-menu { width: 100%; max-height: 280px; overflow-y: auto; top: 100%; left: 0; margin-top: .25rem; }
.lt-rel-menu .dropdown-item { white-space: normal; }
.lt-rel-menu .dropdown-item.active, .lt-rel-menu .dropdown-item:active { background: color-mix(in srgb, var(--lt-accent) 10%, #fff); color: inherit; }
.lt-rel.is-invalid ~ .invalid-feedback, .lt-rel .is-invalid ~ .invalid-feedback { display: block; }
.lt-rel[data-rel-readonly] .lt-rel-box { background: #f8f9fa; cursor: default; }
/* Lista de personas (implicados) en fichas y listados */
.lt-av-stack { display: inline-flex; }
.lt-av-stack .lt-av { margin-left: -8px; box-shadow: 0 0 0 2px #fff; }
.lt-av-stack .lt-av:first-child { margin-left: 0; }
.lt-av-more { --lt-av-size: 28px; width: var(--lt-av-size); height: var(--lt-av-size); border-radius: 50%; background: #e5e7eb; color: #374151; font-size: .7rem; font-weight: 600; display: inline-grid; place-items: center; margin-left: -8px; box-shadow: 0 0 0 2px #fff; }
/* Celda con un registro relacionado: nombre + ⋮ pequeño */
.lt-rel-cell { display: inline-flex; align-items: center; gap: .15rem; max-width: 100%; }
.lt-rel-cell > a { overflow: hidden; text-overflow: ellipsis; }
.lt-kebab.is-sm { width: 24px; height: 24px; font-size: .9rem; }
.lt-av-link { display: inline-flex; border-radius: 50%; margin-left: -8px; }
.lt-av-link:first-child { margin-left: 0; }
.lt-av-stack .lt-av-link .lt-av { margin-left: 0; }
.lt-av-link:hover .lt-av, .lt-av-link:focus-visible .lt-av { box-shadow: 0 0 0 2px var(--lt-accent); position: relative; z-index: 1; }

/* ===== Mensajes como hilos (v13) ===== */
.lt-prio-1 { color: #fd7e14; }
.lt-prio-2 { color: #dc3545; }
.lt-chat-item.is-urgent { box-shadow: inset 3px 0 0 #dc3545; }
.lt-chat-item.is-urgent.is-unread { background: #fef2f2; }
.lt-av-pair { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.lt-av-pair .lt-av { position: absolute; box-shadow: 0 0 0 2px #fff; }
.lt-av-pair .lt-av:first-child { top: 0; left: 0; }
.lt-av-pair .lt-av:last-child { right: 0; bottom: 0; }
.lt-chat-item-who { font-size: .75rem; color: var(--lt-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-chat-item-ctx { display: flex; gap: .5rem; font-size: .72rem; color: var(--lt-muted); margin-top: .1rem; overflow: hidden; white-space: nowrap; }
.lt-chat-item-ctx span { overflow: hidden; text-overflow: ellipsis; }
.lt-chat-title { display: flex; align-items: center; gap: .4rem; font-weight: 600; font-size: 1rem; min-width: 0; }
.lt-chat-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-chat-sub { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--lt-muted); min-width: 0; margin-top: .15rem; flex-wrap: wrap; }
.lt-chat-sub .lt-av-stack .lt-av { margin-left: -6px; }
.lt-chat-sub .lt-av-stack span:first-child .lt-av { margin-left: 0; }
.lt-chat-ctx { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; }
.lt-msg-author { font-size: .75rem; font-weight: 600; color: var(--lt-accent); margin-bottom: .1rem; }
.lt-msg-images { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.lt-msg-images img { display: block; max-width: 220px; max-height: 180px; border-radius: .5rem; object-fit: cover; background: #e5e7eb; }
.lt-msg-file { display: flex; align-items: center; gap: .6rem; min-width: 220px; max-width: 320px; margin-top: .35rem; padding: .45rem .6rem; border-radius: .5rem; background: rgba(0, 0, 0, .04); color: inherit; text-decoration: none; }
.lt-msg.is-mine .lt-msg-file { background: rgba(255, 255, 255, .18); color: #fff; }
.lt-msg-file > i:first-child { font-size: 1.4rem; }
.lt-msg-file > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.lt-msg-file-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-msg-file small { opacity: .7; font-size: .72rem; }
.lt-chat-compose-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.lt-chat-files { display: flex; flex-wrap: wrap; gap: .35rem; }
.lt-chat-files:empty { display: none; }
.lt-chat-file { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; padding: .15rem .2rem .15rem .55rem; border-radius: 2rem; background: #f1f3f7; border: 1px solid var(--lt-border); font-size: .8rem; }
.lt-chat-file > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.lt-chat-aside-files a { display: flex; align-items: center; gap: .4rem; font-size: .85rem; text-decoration: none; min-width: 0; }
.lt-chat-aside-files small { color: var(--lt-muted); margin-left: auto; flex-shrink: 0; }

/* ===== Partes y proyectos (v15) ===== */
.lt-narrow { max-width: 820px; }
.lt-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; font-size: .85rem; }
.lt-budget { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); text-align: center; }
.lt-budget > div { padding: .9rem .5rem; display: flex; flex-direction: column; }
.lt-budget > div + div { border-left: 1px solid var(--lt-border); }
.lt-budget strong { font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.lt-budget span { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--lt-muted); }
.lt-budget em { font-style: normal; font-weight: 600; margin-top: .15rem; }
.lt-budget-foot { border-top: 1px solid var(--lt-border); background: #f9fafb; }
.lt-budget-types { border-top: 1px solid var(--lt-border); margin-top: .5rem; }
.lt-budget-types li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem 1rem; font-size: .85rem; }
.lt-budget-types li + li { border-top: 1px solid #f1f3f5; }
.lt-progress { height: 6px; min-width: 90px; }
.lt-col-spent { min-width: 120px; }
.lt-filter-tabs { gap: .25rem; border-bottom: 1px solid var(--lt-border); margin-bottom: 1rem; flex-wrap: nowrap; overflow-x: auto; }
.lt-filter-tabs .nav-link { border: 0; background: none; color: var(--lt-muted); font-size: .875rem; font-weight: 500; padding: .55rem .8rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.lt-filter-tabs .nav-link:hover { color: #111827; }
.lt-filter-tabs .nav-link.active { color: var(--lt-accent); border-bottom-color: var(--lt-accent); }
.lt-filter-count { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 1rem; background: #eef0f4; font-size: .72rem; color: #374151; }
.lt-filter-tabs .nav-link.active .lt-filter-count { background: color-mix(in srgb, var(--lt-accent) 15%, #fff); color: var(--lt-accent); }
@media (min-width: 992px) { .lt-filter-tabs { flex-wrap: wrap; overflow: visible; } }
/* Cronómetro de partes (cabecera) */
.lt-timer { display: inline-flex; align-items: center; gap: .1rem; height: 36px; padding: 0 .2rem 0 .7rem; border-radius: 2rem; background: #fef2f2; border: 1px solid #fecaca; }
.lt-timer-info { display: inline-flex; align-items: center; gap: .45rem; color: #991b1b; text-decoration: none; font-size: .85rem; min-width: 0; }
.lt-timer-dot { width: 8px; height: 8px; border-radius: 50%; background: #dc3545; animation: lt-blink 1.2s infinite; flex-shrink: 0; }
.lt-timer-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.lt-timer-what { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7f1d1d; }
.lt-timer form { margin: 0; }
.lt-timer-stop { width: 28px; height: 28px; border-radius: 50%; border: 0; background: #dc3545; color: #fff; display: grid; place-items: center; margin-left: .3rem; }
.lt-timer-stop:hover { background: #b91c1c; }
@keyframes lt-blink { 50% { opacity: .25; } }
@media (max-width: 767.98px) { .lt-timer-what { display: none; } .lt-timer { padding-left: .5rem; } }
/* Historial de partes (línea de tiempo) */
.lt-timeline { position: relative; padding-left: 0; }
.lt-tl-day { position: relative; margin: 1rem 0 .6rem; }
.lt-tl-day:first-child { margin-top: 0; }
.lt-tl-day span { display: inline-block; background: var(--lt-accent); color: #fff; font-weight: 600; font-size: .8rem; padding: .25rem .65rem; border-radius: .4rem; }
.lt-tl-item { position: relative; display: flex; gap: .9rem; padding-left: .3rem; margin-bottom: .75rem; }
.lt-tl-item::before { content: ""; position: absolute; left: calc(.3rem + 17px); top: 0; bottom: -.75rem; width: 2px; background: #e5e7eb; }
.lt-tl-dot { position: relative; z-index: 1; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--lt-accent); color: #fff; box-shadow: 0 0 0 3px #fff; }
.lt-tl-card { flex: 1; min-width: 0; border: 1px solid var(--lt-border); border-radius: .6rem; background: #fff; }
.lt-tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: .6rem .85rem; border-bottom: 1px solid #f1f3f5; font-size: .92rem; }
.lt-tl-body { padding: .6rem .85rem; font-size: .9rem; white-space: normal; overflow-wrap: anywhere; }
.lt-tl-foot { display: flex; align-items: center; gap: .6rem; padding: 0 .85rem .6rem; }
/* Totales de un listado (DataTable::totals) */
.lt-totals { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.lt-totals > div { flex: 1 1 140px; display: flex; flex-direction: column; padding: .6rem .85rem; border: 1px solid var(--lt-border); border-radius: .6rem; background: #f9fafb; }
.lt-totals span { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--lt-muted); }
.lt-totals strong { font-size: 1.15rem; font-weight: 600; }
.lt-dt-totals:empty { display: none; }

/* ---------- Timeline (components/timeline) ---------- */
.lt-feed-composer { margin-bottom: 1rem; }
.lt-feed-filters { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lt-feed-list { position: relative; }
.lt-feed-day { position: sticky; top: 0; z-index: 1; display: inline-block; margin: .75rem 0 .5rem; padding: .15rem .65rem; border-radius: 999px; background: #eef0f3; font-size: .75rem; font-weight: 600; color: #4b5563; }
.lt-feed-item { display: flex; gap: .75rem; position: relative; padding-bottom: .9rem; }
.lt-feed-item::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: #eef0f3; }
.lt-feed-icon { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: .9rem;
    color: var(--lt-feed-c); background: color-mix(in srgb, var(--lt-feed-c) 12%, #fff); }
.lt-feed-main { flex: 1 1 auto; min-width: 0; padding-top: .3rem; }
.lt-feed-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .875rem; }
.lt-feed-head time { font-size: .75rem; }
.lt-feed-text { margin-top: .35rem; font-size: .875rem; color: #374151; white-space: normal; overflow-wrap: anywhere; }
.lt-feed-note { background: #f6f8fb; border-radius: 0 10px 10px 10px; padding: .55rem .75rem; }
.lt-feed-tools { display: inline-flex; gap: .15rem; }
.lt-feed-tool { border: 0; background: transparent; color: #9ca3af; padding: 0 .25rem; }
.lt-feed-tool:hover { color: var(--lt-accent); }

/* ---------- Tareas (barra de tiempo, elección al parar) ---------- */
.lt-task-bar { height: 5px; margin-top: .25rem; min-width: 90px; }
.lt-choice { display: flex; gap: .5rem; flex-wrap: wrap; }
table.lt-dt td.lt-col-task { min-width: 220px; }
/* Campana de avisos */
.lt-notif { display: flex; gap: .65rem; padding: .6rem 1rem; color: inherit; text-decoration: none; border-bottom: 1px solid #f1f3f5; font-size: .85rem; }
.lt-notif:hover { background: #f8f9fb; }
.lt-notif.is-unread { background: color-mix(in srgb, var(--lt-accent) 6%, #fff); }
.lt-notif.is-unread .lt-notif-text { font-weight: 600; }
.lt-notif-icon { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; color: var(--lt-tl-c); background: color-mix(in srgb, var(--lt-tl-c) 12%, #fff); }
.lt-notif-text { min-width: 0; overflow-wrap: anywhere; }
.lt-notif-text small { display: block; font-weight: 400; color: #9ca3af; font-size: .72rem; margin-top: .1rem; }
/* Tareas en píldoras (tasks::partials/pills) */
.lt-pills-head { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 .5rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.lt-pills-head:first-of-type { margin-top: 0; }
.lt-pills-dot { width: 9px; height: 9px; border-radius: 50%; }
.lt-pills-group { display: grid; gap: .45rem; }
.lt-pill { display: flex; align-items: center; gap: .6rem; padding: .35rem .45rem .35rem .6rem; background: #fff; border: 1px solid var(--lt-border); border-radius: 999px; min-height: 46px; }
.lt-pill:hover { border-color: #cfd4dc; }
.lt-pill.is-running { border-color: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.lt-pill.is-done { opacity: .7; }
.lt-pill.is-dragging { opacity: .5; border-style: dashed; border-color: var(--lt-accent); }
.lt-grip { color: #b6bcc6; cursor: grab; padding: 0 .1rem; font-size: 1.05rem; }
.lt-grip:active { cursor: grabbing; }
.lt-pill-title { font-weight: 600; color: inherit; text-decoration: none; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-pill-title:hover { color: var(--lt-accent); }
.lt-pill-meta { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.lt-pill-tag { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: #eef2ff; color: #4338ca; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lt-pill-tag.is-late { background: #fef2f2; color: #b91c1c; font-weight: 600; }
.lt-pill-time { width: 120px; }
.lt-pill .btn { border-radius: 999px; }
.lt-pill .lt-actions .lt-kebab { width: 28px; height: 28px; }
/* Se adapta al ancho de su caja (ficha con columnas, móvil…), no al de la pantalla */
.lt-pills, .lt-pills-group { container-type: inline-size; }
@container (max-width: 640px) {
    .lt-pill { flex-wrap: wrap; border-radius: 16px; padding: .5rem .6rem; }
    .lt-pill-title { flex-basis: calc(100% - 90px); white-space: normal; }
    .lt-pill-meta { flex-basis: 100%; flex-wrap: wrap; }
    .lt-pill-time { width: auto; flex: 1 1 100px; }
}
/* Acceso directo a «Mis tareas» (cabecera): contador en el color del panel, no es una alerta */
.lt-icon-btn .lt-count.lt-count-soft { background: var(--lt-accent); }
.lt-icon-btn.active { color: var(--lt-accent); background: color-mix(in srgb, var(--lt-accent) 10%, #fff); }
.lt-pill-person { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.lt-pill.is-done .lt-pill-title, .lt-pill.is-cancelled .lt-pill-title { text-decoration: line-through; text-decoration-color: #adb5bd; }
.lt-rot { transition: transform .15s; }
[aria-expanded="true"] > .lt-rot { transform: rotate(90deg); }

/* ---------- Barra de filtros en una línea, chips y totales en franja ---------- */
.lt-filters input[type=date] { width: 9.5rem; flex: 0 0 auto; }
.lt-filters-btn { display: none; }
.lt-filters-n { margin-left: .3rem; background: var(--lt-accent); color: #fff; border-radius: 9px; font-size: .7rem; padding: 0 .4rem; }
.lt-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .1rem 0 .5rem; }
.lt-chip { border: 0; font-size: .78rem; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: .1rem .45rem .1rem .65rem; }
.lt-chip:hover { background: #e0e7ff; }
.lt-chip-clear { border: 0; background: none; color: var(--lt-accent); font-size: .78rem; text-decoration: underline; }
.lt-totals { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0; margin: 0 0 .6rem; padding: .4rem .75rem; border: 1px solid var(--lt-border); border-radius: .5rem; background: #fafbfc; }
.lt-totals > div { flex: 0 0 auto; flex-direction: row; align-items: baseline; gap: .35rem; padding: 0 .9rem; border: 0; border-right: 1px solid var(--lt-border); border-radius: 0; background: none; white-space: nowrap; }
.lt-totals > div:first-child { padding-left: 0; }
.lt-totals > div:last-child { border-right: 0; }
.lt-totals strong { font-size: .95rem; }

/* ---------- Vista compacta (body.lt-dense; interruptor en el menú del avatar) ---------- */
body.lt-dense .lt-content { padding: .9rem 1.1rem; }
body.lt-dense .lt-page-head { margin-bottom: .6rem; align-items: center; }
body.lt-dense .lt-title { font-size: 1.15rem; }
body.lt-dense .lt-title small { font-size: .9rem; }
/* Botones de la cabecera de cada vista (Nuevo, Ajustes…): pequeños en las dos vistas, para ganar altura */
.lt-page-head-actions .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .8rem; --bs-btn-line-height: 1.35; --bs-btn-border-radius: .4rem; }
.lt-page-head-actions { gap: .35rem; }
body.lt-dense .lt-card { padding: .85rem 1rem; }
body.lt-dense .lt-card.p-0 { padding: 0; }
body.lt-dense .lt-card-title { margin-bottom: .6rem; }
body.lt-dense .lt-filter-tabs { margin-bottom: .5rem; }
body.lt-dense .lt-filter-tabs .nav-link { padding: .35rem .6rem; font-size: .82rem; }
body.lt-dense .lt-tabs .nav-link { padding-top: .55rem; padding-bottom: .55rem; }
body.lt-dense div.dt-container div.dt-search input { padding: .25rem .6rem; font-size: .85rem; min-height: 31px; }
body.lt-dense .dt-container .dt-layout-row { margin-top: .35rem; margin-bottom: .35rem; }
body.lt-dense .lt-dt thead th { padding-top: .4rem; padding-bottom: .4rem; font-size: .7rem; }
body.lt-dense table.lt-dt tbody td, body.lt-dense .lt-table tbody td { padding-top: .32rem; padding-bottom: .32rem; font-size: .86rem; }
body.lt-dense table.lt-dt .lt-person-sub { display: none; }
body.lt-dense table.lt-dt .lt-person { gap: .45rem; }
body.lt-dense table.lt-dt .lt-av { --lt-av-size: 24px !important; font-size: .65rem; }
body.lt-dense .lt-footer { padding-top: .5rem; padding-bottom: .5rem; }

/* ---------- Móvil: atajos en una franja fija abajo y buscador tras la lupa ---------- */
.lt-quickbar { display: contents; }
.lt-search-toggle { display: none; }
@media (max-width: 767.98px) {
    .lt-quickbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around; align-items: center;
        background: #fff; border-top: 1px solid var(--lt-border); box-shadow: 0 -4px 14px rgba(0, 0, 0, .06);
        padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom));
    }
    .lt-quickbar .lt-icon-btn { width: 44px; height: 40px; font-size: 1.25rem; }
    .lt-quickbar .lt-drop-panel { width: calc(100vw - 1rem); max-width: none; }
    body.lt-body { padding-bottom: 62px; }
    .lt-search-toggle { display: grid; }
    .lt-search { display: none; }
    body.lt-search-open .lt-search { display: block; position: fixed; top: var(--lt-topbar-h); left: 0; right: 0; padding: .5rem .75rem; background: #fff; border-bottom: 1px solid var(--lt-border); z-index: 1046; }
    .lt-page-head { gap: .4rem; align-items: center; }
    .lt-page-head-title { flex: 1 1 auto; min-width: 0; }
    .lt-page-head-actions { margin-left: auto; }
    .lt-page-head-actions .btn { white-space: nowrap; --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .55rem; --bs-btn-font-size: .8rem; }
    /* Barra de la tabla: buscar · Filtros · exportar en una línea; los filtros se despliegan debajo */
    .dt-container > .dt-layout-row:first-of-type, .dt-container > .row:first-of-type { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: .4rem; margin-left: 0; margin-right: 0; }
    .dt-container > .row:first-of-type > * { width: auto; padding: 0; }
    .dt-container > .row:first-of-type > .dt-layout-start { display: flex; flex: 1 1 0; width: auto; min-width: 0; flex-wrap: wrap; gap: .4rem; }
    .dt-container > .row:first-of-type > .dt-layout-end { flex: 0 0 auto; }
    div.dt-container div.dt-search input { min-width: 0; width: 100%; }
    .dt-container .dt-search { flex: 1 1 0; min-width: 0; }
    .lt-filters-btn { display: inline-flex; align-items: center; gap: .3rem; height: 31px; }
    .lt-filters.is-collapsible:not(.is-open) { display: none; }
    .lt-filters.is-collapsible.is-open { width: 100%; margin-top: .2rem; margin-left: 0 !important; }
    .lt-filters input[type=date] { flex: 1 1 40%; width: auto; }
}

/* --- Reuniones y origen del tiempo -------------------------------------------------------------- */
.lt-origin { white-space: nowrap; font-size: .85em; }
.lt-origin .bi { opacity: .75; }
.lt-avatar-guest { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.lt-minutes { font-size: .95rem; line-height: 1.55; min-height: 16rem; }

/* --- Bloque común de fechas (calendario) --------------------------------------------------------- */
.lt-cal-block { border: 1px dashed var(--lt-border); border-radius: .6rem; padding: .6rem .8rem; }
.lt-cal-block.is-on { border-style: solid; background: var(--bs-tertiary-bg); }
.lt-cal-block:not(.is-on) .lt-cal-fields { display: none; }
.lt-cal-block.is-allday .lt-cal-time { display: none; }

/* --- Calendario común ---------------------------------------------------------------------------- */
.lt-cal-filters { margin-bottom: .75rem; }
.lt-cal-legend { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; padding: .15rem .55rem; border-radius: 999px;
    border: 1px solid var(--lt-cal-c); color: var(--lt-cal-c); cursor: pointer; user-select: none; }
.lt-cal-legend input { accent-color: var(--lt-cal-c); }
.lt-cal .fc { --fc-border-color: var(--lt-border); --fc-today-bg-color: rgba(13, 110, 253, .06); font-size: .85rem; }
.lt-cal .fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 600; text-transform: capitalize; }
.lt-cal .fc .fc-button { padding: .25rem .6rem; font-size: .8rem; text-transform: capitalize; }
.lt-cal .fc .fc-button-primary { background: var(--bs-body-bg); color: var(--bs-body-color); border-color: var(--lt-border); }
.lt-cal .fc .fc-button-primary:not(:disabled).fc-button-active, .lt-cal .fc .fc-button-primary:not(:disabled):active { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.lt-cal .fc-event { cursor: pointer; }
.lt-cal-ev { display: flex; gap: .3rem; align-items: flex-start; overflow: hidden; padding: 1px 2px; }
.lt-cal-ev .lt-avatar { flex: 0 0 auto; width: 18px; height: 18px; font-size: .55rem; border: 1px solid rgba(255, 255, 255, .7); }
.lt-cal-ev-text { min-width: 0; line-height: 1.2; }
.lt-cal-title { font-weight: 600; }
.lt-cal-time { opacity: .85; font-size: .9em; }
.lt-cal-sub { display: block; opacity: .85; font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-cal .fc-list-event .lt-cal-ev, .lt-cal .fc-daygrid-dot-event .lt-cal-ev { color: var(--bs-body-color); }
.lt-cal .lt-cal-closed { opacity: .55; }
.lt-cal .lt-cal-cancelled { opacity: .45; text-decoration: line-through; }
.lt-cal .fc .fc-timegrid-slot { height: 1.9rem; }
.lt-cal .fc-timegrid-event .lt-cal-ev-text { overflow: hidden; }
.lt-cal .fc-timegrid-event .lt-cal-title { overflow-wrap: anywhere; }
.lt-cal .fc-timegrid-event-short .lt-cal-sub, .lt-cal .fc-timegrid-event-short .lt-cal-time { display: none; }
.lt-cal .fc-timegrid-event-short .lt-cal-title { white-space: nowrap; }
.lt-cal .fc-col-header-cell-cushion, .lt-cal .fc-daygrid-day-number { color: var(--bs-body-color); text-decoration: none; text-transform: capitalize; }

/* --- Artículos ----------------------------------------------------------------------------------- */
.lt-form-section { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color);
    margin: 1.5rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--lt-border); }
.lt-form .lt-form-section:first-of-type { margin-top: 0; }
.lt-attr-box { background: var(--bs-tertiary-bg); border-radius: .6rem; padding: .75rem .9rem; }
.lt-col-thumb { width: 52px; }
.lt-thumb { width: 40px; height: 40px; object-fit: contain; border-radius: .4rem; background: #fff; border: 1px solid var(--lt-border); display: inline-grid; place-items: center; color: var(--bs-tertiary-color); }
.lt-thumb-empty { background: var(--bs-tertiary-bg); }
.lt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.lt-gallery-item { position: relative; border: 1px solid var(--lt-border); border-radius: .6rem; overflow: hidden; background: #fff; }
.lt-gallery-item img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.lt-gallery-item.is-main { border-color: var(--bs-primary); box-shadow: 0 0 0 2px rgba(13, 110, 253, .2); }
.lt-gallery-tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: .25rem; padding: .3rem; background: linear-gradient(transparent, rgba(0, 0, 0, .45)); }
.lt-product-photo { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: .6rem; background: #fff; border: 1px solid var(--lt-border); }
.lt-price-big { font-size: 1.35rem; font-weight: 700; }

/* --- Artículos: tabla de variantes ---------------------------------------------------------------- */
.lt-var-axes { display: grid; gap: .6rem; margin-bottom: .75rem; padding: .75rem .9rem; background: var(--bs-tertiary-bg); border-radius: .6rem; }
.lt-var-axis { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; align-items: start; }
.lt-var-axis-name { font-weight: 600; font-size: .85rem; padding-top: .25rem; }
.lt-var-values { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.lt-var-chip { display: inline-flex; margin: 0; cursor: pointer; user-select: none; }
.lt-var-chip input { position: absolute; opacity: 0; pointer-events: none; }
.lt-var-chip span { padding: .15rem .6rem; border: 1px solid var(--lt-border); border-radius: 999px; font-size: .8rem; background: var(--bs-body-bg); }
.lt-var-chip input:checked + span { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.lt-var-chip input:focus-visible + span { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.lt-var-add { display: inline-flex; gap: .25rem; }
.lt-var-add input { width: 8rem; }
.lt-var-table input.form-control { min-width: 6rem; }
.lt-var-table tr.lt-var-new > td { background: rgba(25, 135, 84, .06); }
.lt-var-table tr.lt-var-off > td { opacity: .45; }
.lt-var-err { color: var(--bs-danger); font-size: .75rem; }
@media (max-width: 575.98px) { .lt-var-axis { grid-template-columns: 1fr; } }
.lt-var-table tr.lt-var-off > td:first-child { opacity: 1; }

/* Instalaciones: foto del equipo, imagen de dónde está y planos del local */
.lt-inst-img { max-width: 100%; max-height: 320px; border-radius: .5rem; border: 1px solid var(--bs-border-color); object-fit: contain; background: var(--bs-tertiary-bg); }

/* Incidencias: equipos a elegir, resolver, plan del día y enlace del técnico */
.lt-pick { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem .8rem; max-height: 260px; overflow: auto; }
.lt-pick.is-invalid { border-color: var(--bs-danger); }
.lt-resolve-item { display: flex; gap: .75rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.lt-resolve-item select { min-width: 150px; }
.lt-plan { display: flex; flex-direction: column; gap: .75rem; }
.lt-plan-item { display: flex; gap: 1rem; align-items: flex-start; }
.lt-plan-num { flex: 0 0 2rem; height: 2rem; border-radius: 50%; background: var(--lt-accent, #0d6efd); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.lt-auth-box:has(.lt-visit) { max-width: 640px; }
@media (max-width: 575px) { .lt-resolve-item { flex-direction: column; } .lt-resolve-item select { width: 100%; } }

/* Píldoras de tarea: proyecto y cliente con su ⋮ */
.lt-pill-tag.lt-pill-rel { display: inline-flex; align-items: center; gap: .2rem; overflow: visible; padding-right: .2rem; }
.lt-pill-rel .lt-rel-cell > a { color: inherit; max-width: 180px; white-space: nowrap; }
.lt-pill-rel .lt-kebab { padding: 0 .15rem; }

/* Ficha común (components/record): columna lateral plegable en escritorio */
.lt-record-aside { position: relative; }
.lt-record-toggle { position: absolute; top: .5rem; right: -.35rem; z-index: 3; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg); color: var(--bs-secondary-color); align-items: center; justify-content: center; padding: 0; font-size: .8rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.lt-record-toggle:hover { color: var(--lt-accent, #0d6efd); border-color: currentColor; }
@media (min-width: 992px) {
    .lt-record.is-collapsed > .lt-record-aside { flex: 0 0 2.5rem; width: 2.5rem; max-width: 2.5rem; }
    .lt-record.is-collapsed > .lt-record-aside > .lt-record-aside-body { display: none; }
    .lt-record.is-collapsed > .lt-record-aside > .lt-record-toggle { position: sticky; top: .5rem; right: auto; margin-top: .5rem; }
    .lt-record.is-collapsed > .lt-record-main { flex: 1 1 0; width: auto; max-width: none; }
}

/* Asistente de IA (botón flotante y panel lateral) */
.lt-ai-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 0;
    background: var(--lt-accent, #4f46e5); color: #fff; font-size: 1.35rem; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.lt-ai-fab:hover { filter: brightness(1.08); }
.lt-ai-panel { --bs-offcanvas-width: 440px; transition: width .2s; }
.lt-ai-panel.lt-ai-full { --bs-offcanvas-width: 100vw; }
.lt-ai-full .lt-ai-body > *, .lt-ai-full .lt-ai-form, .lt-ai-full .lt-ai-foot { width: 100%; max-width: 900px; margin-left: auto; margin-right: auto; }
.lt-ai-body { display: flex; flex-direction: column; background: var(--bs-tertiary-bg); }
.lt-ai-thread { display: flex; flex-direction: column; gap: .6rem; }
.lt-ai-msg { max-width: 92%; padding: .55rem .8rem; border-radius: .8rem; font-size: .9rem; line-height: 1.45; word-wrap: break-word; }
.lt-ai-user { align-self: flex-end; background: var(--lt-accent, #4f46e5); color: #fff; border-bottom-right-radius: .2rem; }
.lt-ai-assistant { align-self: flex-start; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-bottom-left-radius: .2rem; }
.lt-ai-assistant a { word-break: break-all; }
.lt-ai-note { align-self: center; font-size: .78rem; color: var(--bs-secondary-color); background: transparent; padding: 0 .5rem; text-align: center; }
.lt-ai-error { align-self: center; font-size: .82rem; color: var(--bs-danger); background: var(--bs-danger-bg-subtle); }
.lt-ai-thinking { align-self: flex-start; color: var(--bs-secondary-color); font-size: .85rem; }
.lt-ai-welcome { text-align: center; padding: 1rem .5rem; }
.lt-ai-welcome > .bi { font-size: 2rem; color: var(--lt-accent, #4f46e5); }
.lt-ai-proposals { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
.lt-ai-allbar { position: sticky; top: -1rem; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .5rem .6rem; border-radius: .5rem;
    background: var(--bs-success-bg-subtle); border: 1px solid var(--bs-success-border-subtle); }
.lt-ai-proposal { background: var(--bs-body-bg); border: 1px solid var(--bs-warning-border-subtle); border-left: 3px solid var(--bs-warning); border-radius: .5rem; padding: .6rem .7rem; }
.lt-ai-proposal.is-closed { border-color: var(--bs-border-color); border-left-color: var(--bs-border-color); opacity: .85; }
.lt-ai-form { display: flex; gap: .5rem; padding: .75rem 1rem .25rem; border-top: 1px solid var(--bs-border-color); }
.lt-ai-form textarea { resize: none; }
.lt-ai-foot { padding: 0 1rem .6rem; font-size: .72rem; }
.lt-ai-history-item + .lt-ai-history-item { border-top: 1px solid var(--bs-border-color-translucent); }

/* Asistente: dictado por voz */
.lt-ai-form [data-ai-mic].is-recording { animation: lt-pulse 1.2s ease-in-out infinite; }
@keyframes lt-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,.45); } 50% { box-shadow: 0 0 0 .35rem rgba(220,53,69,0); } }

/* Asistente: modo voz y botón en la franja inferior del móvil */
.lt-ai-msg { position: relative; }
.lt-ai-speak { border: 0; background: transparent; color: var(--bs-secondary-color); padding: 0 .1rem; margin-left: .35rem; font-size: .9rem; vertical-align: baseline; }
.lt-ai-speak:hover, .lt-ai-speak.is-speaking { color: var(--lt-accent, #4f46e5); }
.lt-ai-speak.is-speaking i { animation: lt-pulse-text 1s ease-in-out infinite; }
@keyframes lt-pulse-text { 50% { opacity: .35; } }
.lt-ai-foot select { max-width: 100%; }
.lt-ai-quick { display: none; }
@media (max-width: 767.98px) {
    .lt-ai-fab { display: none; }
    .lt-ai-quick { display: grid; color: var(--lt-accent, #4f46e5); }
}
.lt-ai-msg a.lt-ai-file { display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem; padding: .3rem .6rem; border-radius: .4rem; background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); text-decoration: none; font-weight: 600; }
