/* ─────────────────────────────────────────────
 * Módulo TaskFlow — tablero Kanban
 * ───────────────────────────────────────────── */

/* ── Contenedor principal ── */
.mod-taskflow {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mod-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

/* ── Stats ── */
.tf-stats {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

/* Compact override: horizontal layout, reducido para 6 columnas */
.tf-stats .stat-card {
    padding: 9px 13px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border-left-width: 3px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
    user-select: none;
}

.tf-stats .stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,.12);
    background-color: var(--surface-blue);
}

.tf-stats .stat-card.stat-card--activo {
    background-color: var(--info-bg);
    box-shadow: 0 0 0 2px var(--primary);
    transform: translateY(-1px);
}

.tf-stats .stat-card.stat-card--activo .stat-label {
    color: var(--color-accent);
    font-weight: 700;
}

.tf-stats .stat-card .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    min-width: 20px;
    text-align: right;
}

.tf-stats .stat-card .stat-label {
    font-size: 0.68rem;
    line-height: 1.3;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tf-stat--no-iniciado { border-left-color: #6b7280; }
.tf-stat--en-curso    { border-left-color: #f59e0b; }
.tf-stat--finalizado  { border-left-color: #10b981; }
.tf-stat--vencida     { border-left-color: #ef4444; }
.tf-stat--urgente     { border-left-color: #f97316; }

/* ── Barra de filtros ── */
.tf-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.tf-filtro-input,
.tf-filtro-select {
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--color-text);
    background: #f9fafb;
    padding: 0 10px;
    transition: border-color var(--transition-speed);
}

.tf-filtro-input {
    flex: 1;
    min-width: 180px;
}

.tf-filtro-select {
    min-width: 140px;
}

.tf-filtro-input:focus,
.tf-filtro-select:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #ffffff;
}



.tf-btn-limpiar {
    margin-left: auto;
    white-space: nowrap;
}

/* Botón × del buscador — solo visible en móvil (media query lo activa) */
.tf-buscar-clear {
    display: none;
}

/* ── Tablero Kanban ── */
.tf-tablero {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: flex-start;
    min-height: 400px;
}

.tf-tablero-cargando,
.tf-tablero-vacio {
    width: 100%;
    padding: 48px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ── Columna ── */
.tf-columna {
    flex: 0 0 240px;
    width: 240px;
    display: flex;
    flex-direction: column;
    background: #f3f4f6;
    border-radius: var(--radius);
    overflow: hidden;
}

.tf-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: #fff;
    color: #1f2937;
    border-left: 4px solid transparent;
}

.tf-col-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
}

.tf-col-badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
}

.tf-col-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tf-col-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    font-family: var(--font-primary);
    flex-shrink: 0;
}

.tf-col-add-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.tf-col-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
    flex: 1;
    transition: background-color var(--transition-speed);
}

.tf-col-body--over {
    background: var(--surface-blue);
}

/* Drag de columnas */
.tf-col-header[draggable="true"] { cursor: grab; user-select: none; }
.tf-col-header[draggable="true"]:active { cursor: grabbing; }
.tf-columna.tf-col--arrastrando { opacity: 0.4; }
.tf-columna.tf-col--sobre {
    outline: 2px dashed #6366f1;
    outline-offset: -3px;
    border-radius: 10px;
}

.tf-col-vacio {
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
    padding: 20px 8px;
}

/* ── Tarjeta ── */
.tf-card {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: grab;
    transition: box-shadow var(--transition-speed), opacity var(--transition-speed);
}

.tf-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tf-card--dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.tf-card--vencida {
    box-shadow: 0 0 0 1.5px #fca5a5;
}

/* ── Card archivada (en columna Archivo) ── */
.tf-card--archivada {
    opacity: 0.72;
    background: #f9fafb;
}

.tf-card--archivada .tf-card-titulo {
    text-decoration: line-through;
    color: #9ca3af;
}

.tf-card--archivada .tf-card-desc,
.tf-card--archivada .tf-card-meta {
    opacity: 0.6;
}

/* Animación tachar — se aplica justo antes de archivar */
@keyframes tf-tachar {
    0%   { text-decoration: none; opacity: 1; }
    40%  { text-decoration: line-through; opacity: 0.8; }
    100% { text-decoration: line-through; opacity: 0.5; }
}

.tf-card--archiving .tf-card-titulo {
    animation: tf-tachar 0.6s ease-out forwards;
}

/* ── Columna archivo ── */
.tf-columna--archivo {
    opacity: 0.9;
}

.tf-col-header--archivo {
    background: #f9fafb;
    color: #6b7280;
}

.tf-col-header--archivo .tf-col-titulo {
    color: #6b7280;
    font-style: italic;
}

/* Columna de tareas sin tarjeta asignada (visibles solo al filtrar) */
.tf-columna--huerfana {
    opacity: 0.92;
    border: 1.5px dashed #d1d5db;
    border-radius: 10px;
}

.tf-col-header--huerfana {
    background: #fef9ec;
    color: #92400e;
    border-radius: 8px 8px 0 0;
}

.tf-col-header--huerfana .tf-col-titulo {
    color: #92400e;
    font-style: italic;
}

/* Franja de prioridad — oculta */
.tf-card-prio { display: none; }

.tf-card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    cursor: pointer;
}

.tf-card-titulo {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
    word-break: break-word;
}

.tf-card-desc {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.4;
}

.tf-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tf-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-top: 2px;
}

.tf-card-resp {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.tf-meta-sin {
    color: #9ca3af;
    font-style: italic;
}

.tf-card-fecha {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
}

.tf-card-fecha--vencida {
    color: #ef4444;
    font-weight: 600;
}

.tf-card-acciones {
    display: none;
    gap: 4px;
    padding: 6px 10px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.tf-card:hover .tf-card-acciones {
    display: flex;
}

.tf-card-btn {
    flex: 1;
    padding: 4px 6px;
    font-size: 0.72rem;
    font-family: var(--font-primary);
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.tf-card-btn:hover {
    background: #f3f4f6;
}

.tf-card-btn--danger {
    border-color: #fca5a5;
    color: #ef4444;
}

.tf-card-btn--danger:hover {
    background: #fef2f2;
}

/* ── Badges ── */
.tf-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.tf-badge--cliente {
    background: var(--info-bg);
    color: var(--info-text);
}

.tf-badge--prio.tf-badge--critica { background: #fee2e2; color: #b91c1c; }
.tf-badge--prio.tf-badge--alta    { background: #ffedd5; color: #c2410c; }
.tf-badge--prio.tf-badge--media   { background: var(--info-bg); color: var(--info-text); }
.tf-badge--prio.tf-badge--baja    { background: var(--success-bg); color: var(--success-text); }

.tf-badge--vencida {
    background: #fee2e2;
    color: #b91c1c;
}

.tf-badge--estado-no_iniciado { background: #f3f4f6; color: #374151; }
.tf-badge--estado-en_curso    { background: #fef3c7; color: #92400e; }
.tf-badge--estado-finalizado  { background: #d1fae5; color: #065f46; }

/* ── Modal de detalle de tarea (centrado) ── */
.tf-panel {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.tf-panel.hidden {
    display: none;
}

.tf-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.tf-panel-box {
    position: relative;
    z-index: 1;
    width: 1200px;
    max-width: 97vw;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.tf-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    border-radius: 14px 14px 0 0;
}

.tf-panel-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    word-break: break-word;
    flex: 1;
}

/* Botones de acción en el header del panel */
.tf-panel-header-acciones {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.tf-panel-hdr-btn {
    height: 26px;
    padding: 0 8px;
    border-radius: var(--radius);
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
    font-family: inherit;
}

.tf-panel-hdr-btn--edit {
    color: #374151;
}

.tf-panel-hdr-btn--edit:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.tf-panel-hdr-btn--archive {
    color: #b91c1c;
    border-color: #fca5a5;
}

.tf-panel-hdr-btn--archive:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.tf-panel-hdr-btn--restore {
    color: var(--info-text);
    border-color: var(--surface-blue);
}

.tf-panel-hdr-btn--restore:hover {
    background: var(--info-bg);
    border-color: var(--primary);
}

.tf-panel-hdr-btn--delete {
    color: #b91c1c;
    border-color: #fca5a5;
    padding: 0 6px;
}

.tf-panel-hdr-btn--delete:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.tf-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* tf-panel-badges eliminado — prioridad y vencida ahora en tf-panel-estado-row */

/* Metadatos en fila horizontal */
.tf-panel-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    font-size: 0.85rem;
    padding-bottom: 10px;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
}

.tf-meta-campo {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 24px 8px 0;
    margin-right: 24px;
    border-right: 1px solid #e5e7eb;
}

.tf-meta-campo:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.tf-meta-campo--estado {
    flex-basis: 100%;
    border-right: none;
    border-top: 1px solid #e5e7eb;
    margin-right: 0;
    padding-top: 10px;
    margin-top: 6px;
}

.tf-meta-campo--estado .tf-panel-estados {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-wrap: wrap;
}

.tf-meta-label {
    font-size: 0.67rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.tf-meta-val {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

/* Fecha + ícono de calendario en el panel meta */
.tf-meta-fecha-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tf-meta-fecha-cal {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 1px 3px;
    border-radius: 4px;
    opacity: 0.4;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.tf-meta-fecha-cal:hover {
    opacity: 1;
    background: var(--bg-hover, #f3f4f6);
}

.tf-panel-vencida {
    color: #ef4444;
    font-weight: 600;
}

.tf-panel-section {
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
    padding-bottom: 4px;
}

/* Adjuntos y Comentarios lado a lado */
.tf-panel-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    border-top: 1px solid #f3f4f6;
}

.tf-panel-2col .tf-panel-section {
    border-top: none;
    padding-top: 10px;
}

.tf-panel-2col .tf-panel-section:last-child {
    border-left: 1px solid #f3f4f6;
    padding-left: 16px;
}

.tf-panel-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 6px;
}

.tf-panel-desc {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ── Edición inline de descripción ── */
.tf-desc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tf-desc-header .tf-panel-section-title {
    margin-bottom: 0;
}

.tf-desc-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #9ca3af;
    padding: 2px 6px;
    border-radius: var(--radius, 6px);
    transition: background 0.12s, color 0.12s;
    line-height: 1;
}

.tf-desc-edit-btn:hover {
    background: var(--background-soft);
    color: var(--primary);
}

.tf-desc-vacia {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.tf-desc-textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px 10px;
    font-size: 0.875rem;
    font-family: var(--font-primary, sans-serif);
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: var(--radius, 6px);
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.15s;
    line-height: 1.55;
}

.tf-desc-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(72, 147, 198, 0.15);
}

.tf-desc-edit-btns {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ── Widget etiquetas inline (panel detalle) ── */
.tf-etiq-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tf-etiq-panel-header .tf-panel-section-title {
    margin-bottom: 0;
}

.tf-etiq-add-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tf-etiq-add-btn:hover {
    background: var(--primary);
    color: #fff;
}

.tf-etiq-chip--panel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-primary, sans-serif);
    padding: 2px 8px 2px 8px;
    border-radius: 999px;
    border: 1px solid;
    user-select: none;
}

.tf-etiq-chip-x {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0 0 2px;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.tf-etiq-chip-x:hover {
    opacity: 1;
}

.tf-etiq-panel-dropdown {
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius, 6px);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    overflow: hidden;
}

.tf-etiq-panel-dropdown.hidden {
    display: none;
}

.tf-etiq-drop-existentes {
    display: flex;
    flex-direction: column;
    max-height: 160px;
    overflow-y: auto;
}

.tf-etiq-drop-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-family: var(--font-primary, sans-serif);
    background: none;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.12s;
}

.tf-etiq-drop-item:hover {
    background: #f9fafb;
}

.tf-etiq-drop-vacio {
    font-size: 0.78rem;
    color: #9ca3af;
    padding: 8px 12px;
    display: block;
}

.tf-etiq-drop-nueva {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tf-etiq-nueva-input {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.8rem;
    font-family: var(--font-primary, sans-serif);
    border: 1px solid #d1d5db;
    border-radius: var(--radius, 6px);
    outline: none;
}

.tf-etiq-nueva-input:focus {
    border-color: var(--color-accent, #6366f1);
}

.tf-etiq-nueva-color {
    width: 30px;
    height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    padding: 1px;
    flex-shrink: 0;
}

.tf-etiq-nueva-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-primary, sans-serif);
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius, 6px);
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.tf-etiq-nueva-btn:hover    { opacity: 0.85; }
.tf-etiq-nueva-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Widget multi-responsable ── */
.tf-resp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tf-resp-section-header .tf-panel-section-title {
    margin-bottom: 0;
}

.tf-resp-add-btn {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-primary, sans-serif);
    color: var(--primary);
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: var(--radius, 6px);
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tf-resp-add-btn:hover {
    background: var(--primary);
    color: #fff;
}

.tf-resp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 28px;
}

.tf-resp-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-blue);
    border: 1px solid var(--border-medium);
    color: var(--primary-dark);
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.tf-resp-pill-x {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-dark);
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 50%;
    transition: background 0.12s, color 0.12s;
}

.tf-resp-pill-x:hover {
    background: var(--accent-light);
    color: var(--primary-dark);
}

.tf-resp-vacio,
.tf-resp-cargando {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Dropdown para agregar usuario */
.tf-resp-dropdown {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius, 8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.tf-resp-dropdown.hidden {
    display: none;
}

.tf-resp-drop-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-family: var(--font-primary, sans-serif);
    color: #374151;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.12s;
}

.tf-resp-drop-item:hover {
    background: #f3f4f6;
}

.tf-resp-drop-vacio {
    display: block;
    padding: 10px 14px;
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Historial de asignaciones */
.tf-resp-historial {
    margin-top: 6px;
}

.tf-resp-hist-titulo {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin-bottom: 8px;
    margin-top: 10px;
}

.tf-resp-hist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
    padding: 3px 0;
}

.tf-resp-hist-item strong {
    color: #374151;
    font-weight: 600;
}

.tf-resp-hist-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
}

.tf-resp-hist-dot--add {
    background: #10b981;
}

.tf-resp-hist-dot--rem {
    background: #ef4444;
}

/* Fila de estado + prioridad debajo del bloque de meta */
.tf-panel-estado-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0 4px;
    border-top: 1px solid #f3f4f6;
}

.tf-panel-estados {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.tf-estado-btn {
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-family: var(--font-primary);
    font-weight: 500;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.tf-estado-btn:hover {
    background: #f3f4f6;
}

.tf-estado-btn--activo {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

.tf-panel-acciones {
    display: flex;
    gap: 10px;
}

.tf-panel-error {
    color: #ef4444;
    font-size: 0.875rem;
}

/* ── Comentarios ── */
.tf-comentarios {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.tf-sin-comentarios {
    color: #9ca3af;
    font-size: 0.85rem;
    font-style: italic;
}

.tf-comentario {
    background: #f9fafb;
    border-radius: var(--radius);
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
}

.tf-comentario-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.tf-comentario-meta strong {
    font-size: 0.82rem;
    color: var(--color-text);
}

.tf-comentario-meta span {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
}

.tf-comentario-texto {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.5;
}

.tf-add-comentario {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tf-add-comentario textarea {
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    padding: 8px 10px;
    resize: vertical;
    transition: border-color var(--transition-speed);
}

.tf-add-comentario textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.tf-btn-comentar {
    align-self: flex-end;
}

/* ── Tarjeta seleccionada ── */
.tf-card--seleccionada {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(72, 147, 198, 0.35);
    outline: none;
}

.tf-card--seleccionada::before {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Animación de resaltado al navegar desde notificación ── */
@keyframes tf-flash-card {
    0%   { box-shadow: 0 0 0 3px rgba(59,130,246,0.9); background: rgba(219,234,254,0.6); }
    40%  { box-shadow: 0 0 0 6px rgba(59,130,246,0.5); background: rgba(219,234,254,0.8); }
    70%  { box-shadow: 0 0 0 3px rgba(59,130,246,0.4); background: rgba(219,234,254,0.4); }
    100% { box-shadow: none; background: transparent; }
}

.tf-card--flash {
    animation: tf-flash-card 2.8s ease-out forwards;
    border-color: #3b82f6 !important;
    z-index: 2;
}

/* Necesitamos position relative en la card para que el ::before se posicione bien */
.tf-card {
    position: relative;
}

/* ── Barra flotante de selección múltiple ── */
.tf-selection-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e2a38;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    z-index: 350;
    white-space: nowrap;
    flex-wrap: wrap;
}

.tf-selection-bar.hidden {
    display: none;
}

.tf-sel-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #93c5fd;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.tf-sel-acciones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tf-sel-acciones .tf-filtro-select {
    height: 32px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    min-width: 160px;
}

.tf-sel-acciones .btn {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.tf-sel-acciones .btn-ghost {
    border-color: rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
    background: transparent;
}

.tf-sel-acciones .btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

/* ── Input inline de edición de título ── */
.tf-card-titulo {
    cursor: default;
}

.tf-titulo-input {
    width: 100%;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: var(--color-text);
    border: 1.5px solid var(--primary);
    border-radius: 3px;
    padding: 2px 5px;
    background: #fff;
    outline: none;
    line-height: 1.35;
    box-shadow: 0 0 0 3px rgba(72, 147, 198, 0.12);
}

/* ── Modal ancho ── */
.modal-box--wide {
    width: 680px;
    max-width: 96vw;
}

/* ── Modal de tarea: altura limitada con body scrollable y footer siempre visible ── */
#modal-tf .modal-box {
    max-height: 90vh;
}

#modal-tf form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#modal-tf .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#modal-tf .modal-footer {
    flex-shrink: 0;
}

/* ── btn-danger (si no está definido globalmente) ── */
.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
    border: none;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

/* ── req asterisco ── */
.req {
    color: var(--danger);
}

/* ─────────────────────────────────────────────
 * Vista de Planes (landing del módulo)
 * ───────────────────────────────────────────── */

/* Header con botón atrás + título */
.tf-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tf-header-left .mod-subtitle {
    margin-top: 0;
}

/* Grid de tarjetas de plan */
.tf-planes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 4px;
}

/* Tarjeta de plan */
.tf-plan-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow var(--transition-speed), border-color var(--transition-speed), transform var(--transition-speed);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tf-plan-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

/* Avatar letra */
.tf-plan-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--color-accent);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    user-select: none;
    letter-spacing: 0.02em;
}

/* Columna de info */
.tf-plan-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tf-plan-nombre {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.tf-plan-cliente {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Fila de estadísticas pequeñas */
.tf-plan-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.tf-plan-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.tf-plan-stat--no-iniciado { background: #f3f4f6; color: #374151; }
.tf-plan-stat--en-curso    { background: #fef3c7; color: #92400e; }
.tf-plan-stat--finalizado  { background: #d1fae5; color: #065f46; }
.tf-plan-stat--vacio       { background: #f3f4f6; color: #9ca3af; }

/* Alerta vencidas */
.tf-plan-alerta {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ef4444;
    margin-top: 2px;
}

/* Botones editar / eliminar (aparecen al hover) */
.tf-plan-card-acciones {
    position: absolute;
    top: 8px;
    right: 32px;
    display: none;
    gap: 4px;
}

.tf-plan-card:hover .tf-plan-card-acciones {
    display: flex;
}

.tf-plan-btn-edit,
.tf-plan-btn-del {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    z-index: 1;
}

.tf-plan-btn-edit:hover {
    background: #eff6ff;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.tf-plan-btn-del:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* Flecha decorativa al final de la card */
.tf-plan-arrow {
    flex-shrink: 0;
    font-size: 1.1rem;
    color: #d1d5db;
    transition: color var(--transition-speed), transform var(--transition-speed);
    user-select: none;
}

.tf-plan-card:hover .tf-plan-arrow {
    color: var(--color-accent);
    transform: translateX(3px);
}

/* Estado vacío de la vista de planes */
.tf-planes-vacio {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 64px 24px;
    text-align: center;
    color: #9ca3af;
}

.tf-planes-vacio-icon {
    font-size: 2.8rem;
    line-height: 1;
    opacity: 0.5;
}

.tf-planes-vacio-hint {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ── Acciones del header del tablero ── */
.tf-header-acciones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Etiqueta chip (color dinámico vía inline style) ── */
.tf-etiq-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1.5px solid currentColor;
    white-space: nowrap;
    line-height: 1.4;
}

/* Chip de tipo de tarjeta (encima del título, color dinámico vía inline style) */
.tf-card-tarjeta-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    border: 1px solid currentColor;
    margin-bottom: 4px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Chips dentro de la tarjeta Kanban */
.tf-card-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 2px;
}

/* Fila de chips de etiquetas en el panel */
.tf-etiq-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Picker de asignados en el modal de tarea ── */
.tf-asignados-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    background: #f9fafb;
    max-height: 160px;
    overflow-y: auto;
}

.tf-picker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color var(--transition-speed);
    min-width: 120px;
}

.tf-picker-item:hover {
    background: var(--surface-blue);
}

.tf-picker-item input[type="checkbox"] {
    accent-color: var(--color-accent);
}

/* ── Picker de etiquetas en el modal de tarea ── */
.tf-etiquetas-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    background: #f9fafb;
    min-height: 46px;
}

/* Chip seleccionable dentro del picker (estado inactivo y activo) */
.tf-etiq-chip--sel {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-speed), transform var(--transition-speed);
    user-select: none;
}

.tf-etiq-chip--sel:hover {
    opacity: 0.8;
    transform: scale(1.04);
}

.tf-etiq-chip--activa {
    opacity: 1 !important;
    box-shadow: 0 0 0 2px currentColor;
}

/* ── Chips de asignados en el panel ── */
.tf-asignados-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tf-asignado-chip {
    display: inline-flex;
    align-items: center;
    background: var(--surface-blue);
    color: var(--primary-dark);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
}

/* ── Texto vacío genérico ── */
.tf-picker-vacio {
    font-size: 0.82rem;
    color: #9ca3af;
    font-style: italic;
}

/* ── Modal de gestión de etiquetas ── */
.modal-box--etiquetas {
    width: 520px;
    max-width: 96vw;
}

/* ── Modal de confirmación compacto ── */
.modal-box--confirm {
    width: 380px;
    max-width: 94vw;
}

/* El overlay del confirm debe quedar por encima del panel lateral (z-index: 400) */
#modal-tf-confirm {
    z-index: 600;
}

.tf-confirm-msg {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 0 0 20px;
}

.tf-confirm-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.tf-etiq-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    max-height: 240px;
    overflow-y: auto;
}

.tf-etiq-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    background: #f9fafb;
    border-radius: var(--radius);
    border: 1px solid #e5e7eb;
}

.tf-etiq-item-btns {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.tf-etiq-btn-ed,
.tf-etiq-btn-del {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color var(--transition-speed);
}

.tf-etiq-btn-ed:hover  { background: #eff6ff; border-color: var(--color-accent); color: var(--color-accent); }
.tf-etiq-btn-del:hover { background: #fef2f2; border-color: #fca5a5; color: #ef4444; }

.tf-etiq-form-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
}

.tf-etiq-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Botones del formulario de etiquetas / tarjetas */
.tf-etiq-form-btns {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.tf-etiq-input {
    flex: 1;
    min-width: 160px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    padding: 0 10px;
    transition: border-color var(--transition-speed);
}

.tf-etiq-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.tf-etiq-color {
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    padding: 2px;
    cursor: pointer;
    background: transparent;
    flex-shrink: 0;
}

/* ── Sección adjuntos en el panel ── */
.tf-adjuntos-lista {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.tf-adjunto-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
}

.tf-adjunto-icono {
    font-size: 1.2rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.tf-adjunto-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tf-adjunto-nombre {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.tf-adjunto-nombre:hover { text-decoration: underline; }

.tf-adjunto-desc {
    font-size: 0.78rem;
    color: #374151;
}

/* Etiqueta "Corresponde a lista" en archivos y PDFs */
.tf-adjunto-lista-ref {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6366f1;
    background: #6366f118;
    border: 1px solid #6366f140;
    border-radius: 10px;
    padding: 1px 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* En imágenes: badge superpuesto en la esquina inferior */
.tf-adjunto-item--imagen.tf-adjunto-item--con-lista {
    position: relative;
}

.tf-adjunto-item--imagen .tf-adjunto-lista-ref {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 6px;
    background: rgba(99,102,241,0.85);
    color: #fff;
    border: none;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.tf-adjunto-meta {
    font-size: 0.72rem;
    color: #9ca3af;
}

.tf-adjunto-del {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1;
    transition: background-color var(--transition-speed);
}

.tf-adjunto-del:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* Zona de carga de adjuntos */
.tf-adjuntos-zona {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tf-adjuntos-acciones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tf-btn-adj-file,
.tf-btn-adj-cam,
.tf-btn-adj-paste {
    cursor: pointer;
    user-select: none;
    padding: 4px 10px;
    font-size: 0.78rem;
    height: auto;
    line-height: 1.4;
}

.tf-adjuntos-hint {
    font-size: 0.78rem;
    color: #9ca3af;
}

/* Adjunto pendiente (preview + descripción) */
.tf-adjuntos-pending {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--info-bg);
    border: 1.5px dashed var(--primary);
    border-radius: var(--radius);
}

.tf-adjuntos-pending.hidden {
    display: none;
}

.tf-adjunto-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tf-adjunto-img-preview {
    max-width: 160px;
    max-height: 120px;
    border-radius: 4px;
    border: 1px solid #bfdbfe;
    object-fit: contain;
}

.tf-adjunto-nombre-preview {
    font-size: 0.82rem;
    color: #374151;
    word-break: break-word;
}

.tf-adjunto-desc-input {
    width: 100%;
    height: 34px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    padding: 0 10px;
    transition: border-color var(--transition-speed);
    box-sizing: border-box;
}

.tf-adjunto-desc-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Select para asociar el adjunto a un ítem del checklist */
.tf-adj-chk-sel {
    width: 100%;
    height: 34px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    padding: 0 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition-speed);
    box-sizing: border-box;
}

.tf-adj-chk-sel:focus {
    outline: none;
    border-color: var(--color-accent);
}

.tf-adjunto-pending-btns {
    display: flex;
    gap: 8px;
}

/* ── Lista de comprobación (Checklist) ── */
.tf-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.tf-checklist-header .tf-panel-section-title {
    margin-bottom: 0;
}

.tf-checklist-progreso {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.tf-checklist-barra {
    height: 4px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tf-checklist-barra-fill {
    height: 100%;
    background: var(--success);
    border-radius: 99px;
    transition: width 0.3s ease;
}

.tf-checklist-lista {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Handle de drag para reordenar ítems del checklist */
.tf-chk-handle {
    flex-shrink: 0;
    font-size: 1rem;
    color: #d1d5db;
    cursor: grab;
    line-height: 1;
    user-select: none;
    transition: color 0.15s;
}
.tf-checklist-item:hover .tf-chk-handle { color: #9ca3af; }
.tf-chk-handle:active { cursor: grabbing; }

.tf-checklist-item.tf-chk-item--arrastrando { opacity: 0.4; }
.tf-checklist-item.tf-chk-item--sobre {
    outline: 2px dashed #6366f1;
    outline-offset: -2px;
}

.tf-checklist-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: background-color var(--transition-speed);
}

/* Wrapper: descripción arriba, acciones abajo */
.tf-chk-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.tf-chk-acciones {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.tf-checklist-item:hover {
    background: #f3f4f6;
}

.tf-checklist-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-speed), background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1;
}

.tf-checklist-check:hover {
    border-color: var(--success);
}

.tf-checklist-check--done {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.tf-checklist-desc {
    flex: 1;
    font-size: 0.85rem;
    color: #374151;
    word-break: break-word;
    cursor: text;
    transition: color var(--transition-speed), text-decoration var(--transition-speed);
}

/* Input inline al editar la descripción (doble clic) */
.tf-chk-desc-edit {
    flex: 1;
    font-size: 0.85rem;
    font-family: inherit;
    color: #111827;
    border: 1px solid #6366f1;
    border-radius: 4px;
    padding: 1px 6px;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 2px #e0e7ff;
}

.tf-checklist-item--done .tf-checklist-desc {
    text-decoration: line-through;
    color: #9ca3af;
}

.tf-checklist-del {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed), background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1;
}

.tf-checklist-item:hover .tf-checklist-del {
    opacity: 1;
}

.tf-checklist-del:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}

.tf-checklist-add {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tf-checklist-input {
    flex: 1;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--color-text);
    background: #fff;
    outline: none;
    transition: border-color var(--transition-speed);
}

.tf-checklist-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(72, 147, 198, 0.15);
}

.tf-checklist-btn-add {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenedor de chips (fecha / inicio / fin) — siempre al extremo derecho */
.tf-chk-chips {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

/* Chip de fecha */
.tf-chk-fecha {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--info-text);
    background: var(--info-bg);
    border: 1px solid var(--surface-blue);
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 500;
    white-space: nowrap;
}

.tf-chk-fecha--btn {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.tf-chk-fecha--btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* Input date oculto en DOM, accedido por showPicker() */
.tf-chk-date-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    border: none;
}

/* Botón calendario junto a cada ítem */
.tf-chk-date-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 4px;
}

.tf-checklist-item:hover .tf-chk-date-btn {
    opacity: 0.55;
}

.tf-chk-date-btn:hover {
    opacity: 1 !important;
    background: var(--info-bg);
}

/* Adjunto imagen — thumbnail compacto */
.tf-adjunto-item--imagen {
    width: 72px;
    height: 72px;
    padding: 0;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
    transition: border-color var(--transition-speed), transform var(--transition-speed);
    background: #f3f4f6;
}

.tf-adjunto-item--imagen:hover {
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.tf-adjunto-item--imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Archivos no-imagen ocupan fila completa */
.tf-adjunto-item:not(.tf-adjunto-item--imagen) {
    flex: 1 1 100%;
}

/* ── Lightbox de adjunto imagen ── */
.tf-adj-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.tf-adj-lightbox-inner {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.tf-adj-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background-color var(--transition-speed);
}

.tf-adj-lightbox-close:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

.tf-adj-lightbox-img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    display: block;
}

.tf-adj-lightbox-meta {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tf-adj-lb-nombre {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
}

.tf-adj-lb-desc {
    font-size: 0.8rem;
    color: #374151;
}

.tf-adj-lb-info {
    font-size: 0.75rem;
    color: #9ca3af;
}

.tf-adj-lb-acciones {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

/* ── Badge de idioma en el header del tablero ── */
.tf-idioma-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--info-bg);
    border: 1px solid var(--surface-blue);
    color: var(--info-text);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
}

.tf-idioma-badge--sec {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

/* ── Bloque de contexto plan/cliente en modal de tarea ── */
.tf-modal-ctx-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--info-bg);
    border: 1px solid var(--surface-blue);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--info-text);
    margin-bottom: 4px;
}

.tf-modal-ctx-info strong {
    color: var(--color-text);
}

/* ── Botón de acceso en plan-card ── */
.tf-plan-btn-access {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    z-index: 1;
}

.tf-plan-btn-access:hover {
    background: var(--info-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Modal de gestión de accesos ── */
.tf-accesos-modal-box {
    max-width: 520px;
    width: 100%;
}

.tf-accesos-seccion {
    margin-bottom: 20px;
}

.tf-accesos-seccion:last-child {
    margin-bottom: 0;
}

.tf-accesos-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.tf-accesos-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tf-acceso-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--background-soft);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.tf-acceso-nombre {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.tf-acceso-btn-revocar {
    font-size: 0.75rem;
    padding: 3px 10px;
    height: 26px;
    color: var(--danger-text);
    border-color: var(--danger-bg);
}

.tf-acceso-btn-revocar:hover {
    background: var(--danger-bg);
    border-color: #fca5a5;
}

.tf-acceso-grant-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tf-acceso-select {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: #ffffff;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.tf-acceso-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(72, 147, 198, 0.15);
}

.tf-accesos-vacio {
    font-size: 0.8125rem;
    color: #9ca3af;
    font-style: italic;
}

.tf-accesos-aviso {
    font-size: 0.8125rem;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 12px;
}

.tf-accesos-cargando {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 0;
}

.tf-accesos-error {
    font-size: 0.875rem;
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* ── Botones de acciones en header de planes ── */
.tf-header-acciones {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Especificidad 0-3-0: supera .btn (0-1-0) y .btn.btn-primary (0-2-0) */
.tf-header-acciones .btn.hidden {
    display: none;
}

/* ── Selector de color en formulario de tarjeta ── */
.tf-color-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tf-color-btn-defecto {
    height: 36px;
    padding: 0 10px;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.tf-color-btn-defecto.tf-color-btn--activo {
    background: var(--background-secondary, #f3f4f6);
    border-color: var(--text-secondary, #6b7280);
    color: var(--text-primary, #111827);
    font-weight: 600;
}

/* Input nativo visible — el browser lo renderiza como swatch de color */
.tf-color-swatch-direct {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    padding: 3px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.15s, border-color 0.15s;
}
.tf-color-swatch-direct::-webkit-color-swatch-wrapper { padding: 0; border-radius: 3px; }
.tf-color-swatch-direct::-webkit-color-swatch         { border: none; border-radius: 3px; }
.tf-color-swatch-direct::-moz-color-swatch            { border: none; border-radius: 3px; }

.tf-color-swatch-direct.tf-color-btn--activo {
    opacity: 1;
    border-color: var(--primary, #6366f1);
}

/* Chip de tarjeta sin color personalizado */
.tf-etiq-chip--sin-color {
    background: var(--background-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* ── Modal resumen global de accesos ── */
.tf-resumen-modal-box {
    max-width: 580px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.tf-resumen-modal-box .modal-body {
    overflow-y: auto;
    padding: 20px 24px;
}

.tf-resumen-cliente {
    margin-bottom: 24px;
}

.tf-resumen-cliente:last-child {
    margin-bottom: 0;
}

.tf-resumen-cliente-nombre {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.tf-resumen-plan {
    padding: 10px 0 10px 12px;
    border-left: 3px solid var(--primary);
    margin-bottom: 10px;
}

.tf-resumen-plan:last-child {
    margin-bottom: 0;
}

.tf-resumen-plan-nombre {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.tf-resumen-usuarios {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tf-resumen-usuario {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
}

.tf-resumen-u-nombre {
    font-weight: 500;
    color: var(--text-primary);
}

.tf-resumen-u-por {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.tf-resumen-sin-accesos {
    font-size: 0.8125rem;
    color: #9ca3af;
    font-style: italic;
    margin: 0;
}

.tf-resumen-vacio {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 24px 0;
}

.tf-resumen-cargando {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 0;
}

.tf-resumen-error {
    font-size: 0.875rem;
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    padding: 8px 12px;
}

/* ══════════════════════════════════════
 * Vista Reportes
 * ══════════════════════════════════════ */

.tf-rep-seccion {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

/* Layout de dos columnas: panel izq + área de gráfico */
.tf-rep-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
    padding: 16px 0 24px;
    flex: 1;
    min-height: 0;
}

/* Panel de configuración */
.tf-rep-panel-config {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 16px;
}

.tf-rep-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin: 0 0 4px;
}

.tf-rep-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    display: block;
    margin-bottom: 4px;
}

.tf-rep-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tf-rep-select,
.tf-rep-date {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.tf-rep-select:focus,
.tf-rep-date:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-alpha, #6366f120);
}

.tf-rep-fechas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Grid de tipos de gráfico */
.tf-rep-tipos-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-top: 4px;
}

.tf-rep-tipos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.tf-rep-tipo-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px 6px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    position: relative;
}

.tf-rep-tipo-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-alpha, #6366f110);
}

.tf-rep-tipo-btn--activo {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-alpha, #6366f115);
}

.tf-rep-tipo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 28px;
}

.tf-rep-tipo-icon svg {
    width: 100%;
    height: 100%;
}

.tf-rep-tipo-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

/* Tooltip con descripción al hover */
.tf-rep-tipo-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #f9fafb;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    width: 220px;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
    text-align: left;
}

.tf-rep-tipo-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    z-index: 100;
}

.tf-rep-tipo-btn:hover::after,
.tf-rep-tipo-btn:hover::before {
    opacity: 1;
}

.tf-rep-config-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.tf-rep-config-btns .btn {
    flex: 1;
    min-width: 80px;
}

.tf-rep-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* Lista de reportes guardados */
.tf-rep-guardado-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--bg);
    transition: border-color 0.15s;
}

.tf-rep-guardado-item:last-child { margin-bottom: 0; }

.tf-rep-guardado-info {
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.tf-rep-guardado-info:hover strong { color: var(--accent); }

.tf-rep-guardado-info strong {
    display: block;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.tf-rep-guardado-meta {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: capitalize;
}

.tf-rep-guardado-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.tf-rep-guardado-del:hover {
    color: var(--danger, #ef4444);
    background: var(--danger-bg, #fee2e2);
}

.tf-rep-vacio {
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
    padding: 12px 0;
    margin: 0;
}

/* Área del gráfico */
.tf-rep-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 24px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.tf-rep-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.tf-rep-chart-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tf-rep-chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.tf-rep-canvas-wrap {
    position: relative;
    max-height: 420px;
}

.tf-rep-canvas-wrap canvas {
    max-height: 420px;
}

/* Tabla resumen */
.tf-rep-tabla-wrap {
    overflow-x: auto;
}

.tf-rep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.tf-rep-table th,
.tf-rep-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tf-rep-table th {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg);
}

.tf-rep-table tbody tr:hover {
    background: var(--bg);
}

/* ══════════════════════════════════════
 * Etiquetas en ítems del checklist
 * ══════════════════════════════════════ */

/* Celda de etiqueta dentro de cada ítem */
.tf-chk-etiq-cell {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Chip cuando ya tiene etiqueta asignada */
.tf-chk-etiq-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
    background: none;
    font-family: inherit;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tf-chk-etiq-chip:hover { opacity: 0.8; }

/* × para quitar etiqueta */
.tf-chk-etiq-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 2px;
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.tf-checklist-item:hover .tf-chk-etiq-clear { opacity: 1; }
.tf-chk-etiq-clear:hover { color: var(--danger, #ef4444); }

/* Botón para añadir etiqueta cuando no hay ninguna */
.tf-chk-etiq-add {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 6px;
    border: 1px dashed var(--border);
    border-radius: 20px;
    background: none;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.tf-checklist-item:hover .tf-chk-etiq-add { opacity: 1; }
.tf-chk-etiq-add:hover { color: var(--accent); border-color: var(--accent); }

/* Dropdown flotante del picker (position:fixed — appended to body) */
.tf-chk-etiq-dropdown {
    position: fixed;
    z-index: 3000;
    min-width: 160px;
    max-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
}

.tf-chk-etiq-dropdown--open {
    display: flex;
}

.tf-chk-etiq-op {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
    border: none;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    transition: background 0.12s;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tf-chk-etiq-op:hover { background: var(--bg); }

.tf-chk-etiq-op--none {
    color: var(--muted);
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    margin-bottom: 4px;
    padding-bottom: 8px;
}

.tf-chk-etiq-op-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Chips de hora inicio / fin en cada ítem del checklist ── */

.tf-chk-inicio,
.tf-chk-fin {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}

.tf-chk-inicio {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.tf-chk-fin {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

/* Botón "▶ Iniciar" y "⏹ fin" — visibles on-hover cuando no hay tiempo registrado */
.tf-chk-iniciar-btn,
.tf-chk-fin-btn {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    font-family: inherit;
    flex-shrink: 0;
}

.tf-chk-iniciar-btn { border: 1px dashed #a7f3d0; color: #059669; }
.tf-chk-fin-btn     { border: 1px dashed #c7d2fe; color: #4f46e5; }

.tf-checklist-item:hover .tf-chk-iniciar-btn,
.tf-checklist-item:hover .tf-chk-fin-btn { opacity: 1; }
.tf-chk-iniciar-btn:hover { background: #ecfdf5; }
.tf-chk-fin-btn:hover     { background: #eef2ff; }

/* Chips existentes son clickables para edición retroactiva */
.tf-chk-inicio.tf-chk-time-btn,
.tf-chk-fin.tf-chk-time-btn { cursor: pointer; }
.tf-chk-inicio.tf-chk-time-btn:hover { opacity: 0.75; }
.tf-chk-fin.tf-chk-time-btn:hover    { opacity: 0.75; }

/* Chip de tiempo total invertido — "t: 15h" */
.tf-chk-tiempo {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde68a;
}

/* ── Picker flotante para editar timestamps manualmente ── */
.tf-chk-time-picker {
    position: fixed;
    z-index: 3000;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 14px 16px 12px;
    display: none;
    flex-direction: column;
    gap: 10px;
    min-width: 270px;
}

.tf-chk-time-picker--open { display: flex; }

.tf-chk-time-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted, #6b7280);
}

/* Fila DD/MM/YYYY + HH:MM — reemplaza el datetime-local nativo del navegador */
.tf-chk-dt-row {
    display: flex;
    gap: 6px;
}

.tf-chk-date-txt,
.tf-chk-time-txt,
.tf-chk-time-input {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.875rem;
    font-family: inherit;
    box-sizing: border-box;
}

.tf-chk-date-txt { width: 112px; flex-shrink: 0; }
.tf-chk-time-txt { flex: 1; min-width: 0; }
.tf-chk-time-input { width: 100%; } /* fallback si aún se usa en algún lugar */

.tf-chk-time-hint {
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
    margin-top: -4px;
}

.tf-chk-time-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tf-chk-time-limpiar { color: var(--danger, #dc2626) !important; }

/* ── Conteo de etiquetas en la sección Etiquetas del panel ── */
.tf-etiq-conteo-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    min-height: 0;
}

.tf-etiq-conteo-label {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.tf-etiq-conteo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.tf-etiq-conteo-n {
    font-size: 0.78rem;
    font-weight: 700;
}

/* ══════════════════════════════════════
 * Personas en ítems del checklist
 * ══════════════════════════════════════ */

.tf-chk-pers-cell {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.tf-chk-pers-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid currentColor;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}

.tf-chk-pers-chip:hover { opacity: 0.8; }

.tf-chk-pers-clear {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    font-family: inherit;
}

.tf-checklist-item:hover .tf-chk-pers-clear { opacity: 1; }
.tf-chk-pers-clear:hover { color: var(--danger, #ef4444); }

.tf-chk-pers-add {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 6px;
    border: 1px dashed var(--border);
    border-radius: 20px;
    background: none;
    color: var(--muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.tf-checklist-item:hover .tf-chk-pers-add { opacity: 1; }
.tf-chk-pers-add:hover { color: #6366f1; border-color: #6366f1; }

/* Dropdown flotante del picker de persona */
.tf-chk-pers-dropdown {
    position: fixed;
    z-index: 3000;
    min-width: 160px;
    max-width: 220px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.14);
    padding: 6px 0;
    display: none;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
}

.tf-chk-pers-dropdown--open { display: flex; }

.tf-chk-pers-op {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    transition: background 0.12s;
}

.tf-chk-pers-op:hover { background: var(--bg-hover, #f3f4f6); }

/* ── Indicador de adjuntos en ítems del checklist ── */
.tf-chk-adj-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background: #fef3c7;
    color: #92400e;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.tf-chk-adj-btn:hover {
    background: #fde68a;
    border-color: #d97706;
}

.tf-chk-adj-btn.hidden { display: none !important; }

/* Popover flotante con la lista de archivos */
.tf-chk-adj-drop {
    position: fixed;
    z-index: 3100;
    min-width: 200px;
    max-width: 300px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.14);
    padding: 6px 0;
    display: flex;
    flex-direction: column;
}

.tf-chk-adj-drop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--text);
    transition: background 0.12s;
}

.tf-chk-adj-drop-item:hover { background: var(--bg-hover, #f3f4f6); }

.tf-chk-adj-drop-icon { flex-shrink: 0; font-size: 1rem; }

.tf-chk-adj-drop-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.tf-chk-adj-drop-meta { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }

.tf-chk-pers-op--none {
    color: var(--muted);
    font-style: italic;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.tf-chk-pers-op-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Panel de personas */
.tf-pers-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tf-pers-add-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tf-pers-add-btn:hover {
    background: var(--primary);
    color: #fff;
}

.tf-pers-panel-dropdown {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary, #f9fafb);
    padding: 10px;
}

.tf-pers-drop-existentes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.tf-pers-drop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 10px;
    font-size: 0.82rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.12s, border-color 0.12s;
}

.tf-pers-drop-item:hover { background: #ede9fe; }

.tf-pers-drop-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tf-pers-drop-vacio {
    font-size: 0.8rem;
    color: var(--muted);
}

.tf-pers-drop-nueva {
    display: flex;
    gap: 6px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
}

.tf-pers-nueva-input {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
}

.tf-pers-nueva-color {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.tf-pers-nueva-btn {
    padding: 5px 12px;
    font-size: 0.82rem;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    white-space: nowrap;
}

.tf-pers-nueva-btn:hover { background: #4f46e5; }
.tf-pers-nueva-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Conteo de personas en el panel */
.tf-pers-conteo-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    min-height: 0;
}

.tf-pers-conteo-label {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.tf-pers-conteo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.tf-pers-conteo-n {
    font-size: 0.78rem;
    font-weight: 700;
}

/* Layout 2 columnas para Etiquetas + Personas en el panel */
.tf-panel-2col--etiq-pers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 767px) {
    .tf-panel-2col--etiq-pers {
        grid-template-columns: 1fr;
    }
}

/* @media print */
@media print {
    #sidebar,
    #topbar,
    .tf-rep-panel-config,
    #tf-rep-btn-volver,
    #tf-rep-btn-imprimir {
        display: none !important;
    }

    .tf-rep-layout {
        grid-template-columns: 1fr;
    }

    .tf-rep-area {
        border: none;
        padding: 0;
        box-shadow: none;
    }

    body,
    #app,
    #main-wrapper,
    #content {
        background: white !important;
        color: black !important;
    }
}
