/* ============================================================================
   FORMS V2 — UI stylesheet
   ============================================================================ */

/* ── Tab pane ────────────────────────────────────────────────────────────────── */
/* Neutraliza el bloque legacy de main.css (#pills-forms.show.active { display:block !important; height:100% })
   usando el mismo selector y cargando después.                                    */
#pills-forms {
    flex-direction: column;
    height: calc(100vh - 110px);
    overflow: hidden;
}

#pills-forms.show.active {
    display: flex !important;
    height: calc(100vh - 110px) !important;
    min-height: 0;
    overflow: hidden;
}

#pills-forms > .tab-section-header {
    position: static;
    top: unset;
}

/* ── Layout sidebar + main (mismo patrón que dt-layout) ─────────────────────── */
.fv2-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    background: rgba(10, 14, 26, 0.6);
}

/* Sidebar — reutiliza dt-sidebar pero vía clase adicional fv2-sidebar */
/* Los estilos de .dt-sidebar ya están en main.css, solo ajustamos el estado */
.fv2-sidebar {
    /* los estilos base vienen de .dt-sidebar en main.css */
}

/* Main content area */
.fv2-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

/* Stat value colores */
.fv2-stat-urgent { color: #f87171; }
.fv2-stat-ok     { color: #4ade80; }

/* ── Column headers ──────────────────────────────────────────────────────────── */
:root {
    --fv2-cols: 154px 1fr 90px 102px auto;
}

.fv2-cols-header {
    display: grid;
    grid-template-columns: var(--fv2-cols);
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    flex: 0 0 auto;
}

.fv2-col {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(148, 163, 184, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.4rem;
    display: flex;
    align-items: center;
}

.fv2-col--status  { grid-column: 1; }
.fv2-col--name    { grid-column: 2; overflow: hidden; }
.fv2-col--created { grid-column: 3; }
.fv2-col--publish { grid-column: 4; }
.fv2-col--actions { grid-column: 5; justify-content: flex-end; }

/* nombre: columna vertical con sub-línea de chips */
.fv2-row .fv2-col--name {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
}

/* sub-línea de observaciones bajo el nombre */
.fv2-row-obs {
    font-size: 0.71rem;
    color: rgba(148, 163, 184, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.3;
}

/* sub-línea bajo las obs: tags + asignado */
.fv2-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.5rem;
    min-width: 0;
}

/* ── List scroll ─────────────────────────────────────────────────────────────── */
.fv2-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.fv2-list {
    display: flex;
    flex-direction: column;
    padding: 0.35rem 0 2rem;
}

/* ── Groups ──────────────────────────────────────────────────────────────────── */
.fv2-group { margin-bottom: 0; }

.fv2-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.38rem 0.75rem;
    background: #0d1526;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    position: sticky;
    top: 0;
    z-index: 5;
}

.fv2-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.55);
}

.fv2-group-count {
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(148, 163, 184, 0.7);
    border-radius: 20px;
    padding: 0.08rem 0.45rem;
    font-weight: 600;
}

.fv2-group-rows {
    display: flex;
    flex-direction: column;
    padding-bottom: 0.25rem;
}

/* ── Row ─────────────────────────────────────────────────────────────────────── */
.fv2-row {
    display: grid;
    grid-template-columns: var(--fv2-cols);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    margin: 0 0.5rem 0.28rem;
    align-items: center;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.018);
    transition: background 0.12s, border-color 0.12s;
}

.fv2-row:hover {
    background: rgba(255, 255, 255, 0.038);
    border-color: rgba(148, 163, 184, 0.22);
}

.fv2-row.is-highlighted { animation: fv2Hl 2.2s ease-out; }

@keyframes fv2Hl {
    0%   { background: rgba(59, 130, 246, 0.22); border-color: rgba(59, 130, 246, 0.4); }
    100% { background: rgba(255, 255, 255, 0.018); border-color: rgba(148, 163, 184, 0.1); }
}

.fv2-row--deleting { opacity: 0.4; pointer-events: none; }
.fv2-row .fv2-col  { padding: 0.42rem 0.4rem; min-width: 0; }

/* ── Status column: badge + urgente inline ───────────────────────────────────── */
.fv2-col--status {
    display: flex;
    flex-direction: row;
    gap: 0.28rem;
}

.fv2-status-badge {
    font-size: 0.68rem;
    padding: 0.18rem 0.45rem;
    white-space: nowrap;
    line-height: 1.3;
    flex-shrink: 0;
}

.fv2-urgent-icon {
    color: #f87171;
    font-size: 0.74rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Name button */
.fv2-name-btn {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    transition: color 0.12s;
    display: block;
}
.fv2-name-btn:hover { color: #93c5fd; }

/* Text cells */
.fv2-obs-text  {
    font-size: 0.78rem;
    color: rgba(203, 213, 225, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fv2-date-text {
    font-size: 0.76rem;
    color: rgba(148, 163, 184, 0.65);
    white-space: nowrap;
}

.fv2-assigned-text {
    font-size: 0.78rem;
    color: rgba(203, 213, 225, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fv2-no-data {
    color: rgba(148, 163, 184, 0.25);
    font-size: 0.74rem;
}

/* ── Tag chips in rows ───────────────────────────────────────────────────────── */
.fv2-tag-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.67rem;
    font-weight: 600;
    padding: 0.12rem 0.42rem;
    border-radius: 20px;
    background: color-mix(in srgb, var(--tc, #6366f1) 18%, transparent);
    color: color-mix(in srgb, var(--tc, #6366f1) 90%, #fff);
    border: 1px solid color-mix(in srgb, var(--tc, #6366f1) 35%, transparent);
    white-space: nowrap;
    line-height: 1.4;
}

.fv2-col--tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.22rem;
    overflow: hidden;
    align-items: center;
}

/* ── Publish badges ──────────────────────────────────────────────────────────── */
.fv2-pub-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.69rem;
    font-weight: 600;
    padding: 0.16rem 0.45rem;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.4;
}
.fv2-pub--overdue  { background: rgba(100,116,139,.2);  color: #94a3b8; border: 1px solid rgba(100,116,139,.28); }
.fv2-pub--critical { background: rgba(239,68,68,.15);   color: #fca5a5; border: 1px solid rgba(239,68,68,.32); }
.fv2-pub--warn     { background: rgba(234,179,8,.14);   color: #fde68a; border: 1px solid rgba(234,179,8,.3); }
.fv2-pub--ok       { background: rgba(59,130,246,.12);  color: #93c5fd; border: 1px solid rgba(59,130,246,.28); }

/* Row actions */
.fv2-col--actions {
    display: flex;
    gap: 0.22rem;
    justify-content: flex-end;
    padding-right: 0.25rem;
    flex-wrap: nowrap;
}

.fv2-row-btn {
    padding: 0.22rem 0.42rem;
    font-size: 0.76rem;
    min-height: 26px;
    min-width: 28px;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.fv2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 1.5rem;
    text-align: center;
}
.fv2-empty-icon  { font-size: 2.5rem; color: rgba(148,163,184,.18); }
.fv2-empty-title { font-size: 0.88rem; color: rgba(148,163,184,.38); margin: 0; }
.fv2-empty-mini  { display: flex; align-items: center; padding: 1rem; color: rgba(148,163,184,.45); font-size: 0.82rem; }

/* ── Create modal ────────────────────────────────────────────────────────────── */
.fv2-create-dialog { max-width: 520px; }

.fv2-create-modal {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    overflow: hidden;
}

.fv2-create-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    border-bottom: none;
}
.fv2-create-header-inner { display: flex; align-items: flex-start; gap: 0.9rem; }
.fv2-create-icon { font-size: 1.6rem; color: #bfdbfe; flex-shrink: 0; margin-top: 0.1rem; }
.fv2-create-modal .modal-title { color: #fff; font-size: 1.05rem; }
.fv2-create-sub { color: rgba(191,219,254,.8); font-size: 0.82rem; margin-top: 0.2rem; }
.fv2-create-body { padding: 1.25rem 1.5rem; }

.fv2-create-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(203,213,225,.85);
    margin-bottom: 0.4rem;
    display: block;
}

.fv2-create-input {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.15);
    color: #f1f5f9;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.fv2-create-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.2); }
.fv2-create-input::placeholder { color: rgba(148,163,184,.45); }

.fv2-create-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    background: rgba(255,255,255,.03);
    border-top: 1px solid rgba(255,255,255,.07);
}

/* ── Edit modal (fullscreen) ─────────────────────────────────────────────────── */
/* Bootstrap modal-fullscreen maneja el sizing; solo ajustamos el contenido.      */
.fv2-edit-dialog .modal-content {
    border-radius: 0;
    border: none;
    overflow: hidden;
}

.fv2-edit-modal {
    background: #0b1120;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.fv2-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    flex-shrink: 0;
}
.fv2-edit-header-left { display: flex; align-items: center; gap: 0.7rem; min-width: 0; flex: 1 1 auto; }
.fv2-edit-header-right { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.fv2-edit-header-icon { font-size: 1.3rem; color: #bfdbfe; flex-shrink: 0; }
.fv2-edit-header-title-wrap { min-width: 0; }
.fv2-edit-title { color: #fff; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: clamp(200px, 55vw, 900px); margin: 0; }
.fv2-edit-meta  { color: rgba(191,219,254,.65); font-size: 0.76rem; }
.fv2-edit-status-badge { font-size: 0.68rem; }

/* ── Tab nav ─────────────────────────────────────────────────────────────────── */
.fv2-edit-tabs-nav {
    display: flex;
    padding: 0 0.75rem;
    background: rgba(10, 16, 30, 0.85);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.fv2-edit-tabs-nav::-webkit-scrollbar { display: none; }

.fv2-edit-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.6rem 0.9rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(148,163,184,.65);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color .12s, border-color .12s;
    flex-shrink: 0;
}
.fv2-edit-tab:hover { color: #e2e8f0; }
.fv2-edit-tab.active { color: #60a5fa; border-bottom-color: #3b82f6; }

.fv2-tab-badge {
    background: #3b82f6;
    color: #fff;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.05rem 0.38rem;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}

/* ── Tab panes ───────────────────────────────────────────────────────────────── */
.fv2-edit-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* The form is between .fv2-edit-body and the tab panes — it must propagate height */
#fv2EditForm {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.fv2-tab-pane { display: none; overflow: hidden; }
.fv2-tab-pane--active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

.fv2-pane-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 1.25rem; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.2) transparent; }

/* Formulario tab — grid de dos columnas en pantallas anchas */
.fv2-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    max-width: 100%;
}
@media (min-width: 1100px) {
    .fv2-form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .fv2-form-section--full { grid-column: 1 / -1; }
}

.fv2-form-section {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}
.fv2-form-section--audit { background: rgba(255,255,255,.015); border-style: dashed; }

.fv2-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148,163,184,.55);
    margin-bottom: 0.8rem;
    display: block;
}

.fv2-audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.fv2-audit-item { display: flex; flex-direction: column; gap: 0.12rem; }
.fv2-audit-label { font-size: 0.7rem; color: rgba(148,163,184,.5); }
.fv2-audit-val   { font-size: 0.82rem; color: #e2e8f0; }
.fv2-audit-user  { font-size: 0.76rem; color: rgba(148,163,184,.7); }

/* Tag picker */
/* ── Skeleton pulse animation (used by instant-open modal) ── */
@keyframes fv2SkeletonPulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

/* ── Observations hint in modal header ── */
.fv2-edit-obs-hint {
    font-size: 0.72rem;
    color: rgba(148,163,184,.7);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
    cursor: help;
}

/* ── Tag picker with search ── */
.fv2-tag-search-wrap {
    width: 100%;
    margin-bottom: 0.4rem;
}
.fv2-tag-search-input {
    width: 100%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    color: #e2e8f0;
    outline: none;
    transition: border-color .15s;
}
.fv2-tag-search-input:focus { border-color: rgba(99,102,241,.5); }
.fv2-tag-search-input::placeholder { color: rgba(148,163,184,.4); }
.fv2-tag-pills-wrap { display: flex; flex-wrap: wrap; gap: 0.38rem; align-items: center; }

.fv2-tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    min-height: 32px;
    align-items: flex-start;
    flex-direction: column;
}

.fv2-tag-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
    border-radius: 20px;
    background: rgba(255,255,255,.06);
    color: rgba(148,163,184,.75);
    border: 1px solid rgba(255,255,255,.1);
    cursor: pointer;
    transition: all .12s;
    line-height: 1.3;
}
.fv2-tag-pill:hover { border-color: var(--tc,#6366f1); color: color-mix(in srgb, var(--tc,#6366f1) 90%, #fff); }
.fv2-tag-pill--active {
    background: color-mix(in srgb, var(--tc,#6366f1) 18%, transparent);
    color: color-mix(in srgb, var(--tc,#6366f1) 95%, #fff);
    border-color: color-mix(in srgb, var(--tc,#6366f1) 50%, transparent);
}

/* ── Multi-document layout ───────────────────────��───────────────────────────── */
.fv2-docs-layout { display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }

/* Sidebar */
.fv2-docs-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.07);
    background: rgba(10,16,30,.55);
    overflow: hidden;
}
.fv2-docs-sidebar-head {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem 0.55rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.fv2-docs-sidebar-search-wrap { position: relative; flex: 1; }
.fv2-docs-sidebar-search-icon {
    position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%);
    font-size: 0.68rem; color: rgba(148,163,184,.45); pointer-events: none;
}
.fv2-docs-sidebar-search {
    width: 100%; background: rgba(255,255,255,.04); border: 1px solid rgba(148,163,184,.14);
    border-radius: 6px; color: #e2e8f0; font-size: 0.78rem;
    padding: 0.28rem 0.45rem 0.28rem 1.5rem; outline: none;
}
.fv2-docs-sidebar-search:focus { border-color: rgba(96,165,250,.45); }
.fv2-docs-new-btn { flex-shrink: 0; padding: 0.28rem 0.5rem; }
.fv2-docs-list {
    flex: 1 1 auto; overflow-y: auto; padding: 0.35rem;
    display: flex; flex-direction: column; gap: 0.18rem;
    scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.18) transparent;
}
.fv2-doc-item {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.42rem 0.55rem; border-radius: 6px;
    cursor: pointer; transition: background .12s; min-width: 0;
    border: 1px solid transparent;
}
.fv2-doc-item:hover { background: rgba(255,255,255,.045); }
.fv2-doc-item.active {
    background: rgba(99,102,241,.15);
    border-color: rgba(99,102,241,.28);
}
.fv2-doc-item-icon { color: rgba(148,163,184,.55); font-size: 0.8rem; flex-shrink: 0; }
.fv2-doc-item.active .fv2-doc-item-icon { color: #a5b4fc; }
.fv2-doc-item-title {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 0.79rem; color: rgba(203,213,225,.8);
}
.fv2-doc-item.active .fv2-doc-item-title { color: #e2e8f0; font-weight: 600; }
.fv2-docs-presence-bar {
    padding: 0.45rem 0.6rem; border-top: 1px solid rgba(255,255,255,.05);
    display: flex; gap: 0.25rem; align-items: center; flex-shrink: 0; min-height: 34px;
}

/* Editor area */
.fv2-docs-editor-wrap { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.fv2-docs-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1 1 auto; color: rgba(148,163,184,.38); gap: 0.6rem; font-size: 0.85rem; text-align: center;
}
.fv2-docs-empty-icon { font-size: 2.2rem; opacity: .35; }
.fv2-docs-active-area { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }

/* Title bar */
.fv2-doc-title-bar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}
.fv2-doc-title-input {
    flex: 1; background: transparent; border: none; color: #f1f5f9;
    font-size: 1rem; font-weight: 700; outline: none; min-width: 0;
}
.fv2-doc-title-input::placeholder { color: rgba(148,163,184,.32); }
.fv2-doc-title-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
/* Indicador de guardado — nubecita (misma lógica que el pizarrón) */
.fv2-doc-save-indicator {
    display: flex; align-items: center; gap: 4px; font-size: 0.72rem;
    white-space: nowrap; transition: color .2s, opacity .3s;
}
.fv2-doc-save-indicator .fv2-save-ok,
.fv2-doc-save-indicator .fv2-save-saving,
.fv2-doc-save-indicator .fv2-save-err { display: none; font-size: 0.88rem; }
.fv2-save-label { font-size: 0.68rem; }
.fv2-doc-save-indicator[data-state="saving"] { color: #60a5fa; }
.fv2-doc-save-indicator[data-state="saving"] .fv2-save-saving { display: inline; animation: fv2SavePulse .9s ease-in-out infinite; }
.fv2-doc-save-indicator[data-state="ok"]   { color: #4ade80; }
.fv2-doc-save-indicator[data-state="ok"]   .fv2-save-ok  { display: inline; }
.fv2-doc-save-indicator[data-state="err"]  { color: #f87171; }
.fv2-doc-save-indicator[data-state="err"]  .fv2-save-err { display: inline; }
.fv2-doc-save-indicator[data-state="idle"] { opacity: 0; pointer-events: none; }
@keyframes fv2SavePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.fv2-doc-presence-avatars { display: flex; gap: 0.18rem; }
.fv2-doc-avatar {
    width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-size: 0.6rem;
    font-weight: 700; color: #fff; border: 1.5px solid rgba(0,0,0,.3);
    cursor: default; flex-shrink: 0;
}
.fv2-doc-clone-btn, .fv2-doc-delete-btn { padding: 0.2rem 0.42rem; font-size: 0.72rem; }

/* Color picker */
.fv2-doc-color-wrap { position: relative; display: inline-flex; }
.fv2-doc-color-btn  { display: flex; align-items: center; gap: 0.18rem; }
.fv2-doc-color-swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: #e2e8f0; }
.fv2-doc-color-popup {
    position: absolute; top: calc(100% + 5px); left: 0; z-index: 1080;
    background: #1a2540; border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px; padding: 0.55rem;
    display: grid; grid-template-columns: repeat(8, 20px); gap: 0.22rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.fv2-color-swatch {
    width: 20px; height: 20px; border-radius: 4px; cursor: pointer;
    border: 1.5px solid transparent; transition: transform .1s, border-color .1s;
}
.fv2-color-swatch:hover { transform: scale(1.25); border-color: rgba(255,255,255,.5); }

/* Table picker */
.fv2-doc-table-wrap  { position: relative; display: inline-flex; }
.fv2-doc-table-picker {
    position: absolute; top: calc(100% + 5px); left: 0; z-index: 1080;
    background: #1a2540; border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px; padding: 0.55rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.fv2-table-picker-grid { display: grid; grid-template-columns: repeat(8, 22px); gap: 3px; margin-bottom: 0.3rem; }
.fv2-table-picker-cell {
    width: 22px; height: 22px; border-radius: 3px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); cursor: pointer;
}
.fv2-table-picker-cell.hover { background: rgba(99,102,241,.38); border-color: rgba(99,102,241,.55); }
.fv2-table-picker-label { font-size: 0.7rem; color: rgba(148,163,184,.65); text-align: center; }

/* Selection bubble */
.fv2-selection-bubble {
    position: fixed; z-index: 1200;
    background: #1a2540; border: 1px solid rgba(255,255,255,.15);
    border-radius: 6px; padding: 0.18rem 0.28rem;
    display: flex; align-items: center; gap: 0.08rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.45); pointer-events: auto;
}
.fv2-bubble-btn {
    background: none; border: none; color: rgba(203,213,225,.85);
    cursor: pointer; padding: 0.2rem 0.3rem; border-radius: 4px;
    font-size: 0.82rem; transition: background .1s, color .1s;
}
.fv2-bubble-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.fv2-bubble-sep { width: 1px; height: 14px; background: rgba(255,255,255,.14); margin: 0 0.08rem; }

/* Floating table toolbar */
.fv2-table-toolbar {
    position: fixed; z-index: 1100;
    background: #1a2540; border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px; padding: 0.2rem 0.5rem;
    display: flex; align-items: center; gap: 0.12rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.38); font-size: 0.76rem;
}
.fv2-table-toolbar-label { font-size: 0.68rem; color: rgba(148,163,184,.5); padding: 0 0.2rem; }
.fv2-tbl-btn { font-size: 0.72rem; padding: 0.18rem 0.38rem; gap: 0.2rem; }
.fv2-tbl-del-btn { color: #f87171; }
.fv2-tbl-del-btn:hover { color: #ef4444; background: rgba(239,68,68,.1); }

/* Stage sortable */
.fv2-stage-drag-handle {
    color: rgba(148,163,184,.35); cursor: grab;
    padding: 0 0.3rem; font-size: 0.82rem; flex-shrink: 0;
    transition: color .12s;
}
.fv2-stage-drag-handle:hover { color: rgba(148,163,184,.65); }
.fv2-stage-drag-handle:active { cursor: grabbing; }
.fv2-stage-card.sortable-ghost { opacity: 0.35; }

/* Doc editor: table styles */
.fv2-doc-editor table {
    border-collapse: collapse; width: 100%; margin: 0.7rem 0; font-size: 0.875rem;
}
.fv2-doc-editor table td,
.fv2-doc-editor table th {
    border: 1px solid rgba(148,163,184,.22);
    padding: 0.42rem 0.65rem; min-width: 60px; vertical-align: top;
}
.fv2-doc-editor table th {
    background: rgba(99,102,241,.1); font-weight: 600; color: #a5b4fc;
}
.fv2-doc-editor table tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.fv2-doc-editor table td:focus, .fv2-doc-editor table th:focus {
    outline: 2px solid rgba(99,102,241,.45); outline-offset: -1px;
}

/* Incident clickable link */
.fv2-incident-ref a { color: #93c5fd; text-decoration: none; }
.fv2-incident-ref a:hover { text-decoration: underline; color: #60a5fa; }

/* Description editor (toolbar reuse existing) */

.fv2-doc-toolbar {
    display: flex;
    align-items: center;
    gap: 0.18rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255,255,255,.035);
    border-bottom: 1px solid rgba(148,163,184,.1);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.fv2-doc-sep { width: 1px; height: 16px; background: rgba(148,163,184,.2); margin: 0 0.15rem; flex-shrink: 0; }

.fv2-doc-btn {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(203,213,225,.7);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background .1s, color .1s;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
}
.fv2-doc-btn:hover { background: rgba(255,255,255,.1); color: #f1f5f9; border-color: rgba(255,255,255,.18); }

.fv2-doc-fmt-sel {
    font-size: 0.76rem;
    background: rgba(15,23,42,.95);
    border: 1px solid rgba(148,163,184,.2);
    color: #e2e8f0;
    border-radius: 4px;
    padding: 0.2rem 0.45rem;
    height: 26px;
}

.fv2-doc-editor {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    color: #e2e8f0;
    font-size: 0.925rem;
    line-height: 1.7;
    outline: none;
    min-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.2) transparent;
}
.fv2-doc-editor:empty:before { content: attr(data-placeholder); color: rgba(148,163,184,.3); pointer-events: none; }
.fv2-doc-editor h1 { font-size: 1.75rem; font-weight: 700; margin: 1.2rem 0 0.6rem; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 0.3rem; color: #f1f5f9; }
.fv2-doc-editor h2 { font-size: 1.3rem; font-weight: 700; margin: 1rem 0 0.5rem; color: #e2e8f0; }
.fv2-doc-editor h3 { font-size: 1.05rem; font-weight: 700; margin: 0.85rem 0 0.4rem; color: #cbd5e1; }
.fv2-doc-editor h4 { font-size: 0.92rem; font-weight: 700; margin: 0.7rem 0 0.35rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.fv2-doc-editor p  { margin: 0.4rem 0; }
.fv2-doc-editor blockquote { border-left: 3px solid #3b82f6; margin: 0.75rem 0; padding: 0.5rem 1rem; color: rgba(203,213,225,.8); font-style: italic; background: rgba(59,130,246,.05); border-radius: 0 6px 6px 0; }
.fv2-doc-editor pre { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; padding: 0.75rem 1rem; font-family: monospace; font-size: 0.85rem; color: #a5f3fc; overflow-x: auto; }
.fv2-doc-editor ul, .fv2-doc-editor ol { padding-left: 1.5rem; margin: 0.4rem 0; }
.fv2-doc-editor a  { color: #60a5fa; text-decoration: underline; }
.fv2-doc-editor hr { border: none; border-top: 1px solid rgba(255,255,255,.12); margin: 1rem 0; }

/* Stages */
.fv2-stages-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.fv2-stages-list   { display: flex; flex-direction: column; gap: 0.45rem; }

.fv2-stage-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(148,163,184,.1);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    transition: background .12s;
}
.fv2-stage-card:hover { background: rgba(255,255,255,.06); }
.fv2-stage-left  { display: flex; align-items: center; gap: 0.6rem; min-width: 0; flex: 1 1 auto; }
.fv2-stage-right { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.fv2-stage-icon  { font-size: 0.95rem; color: rgba(148,163,184,.6); flex-shrink: 0; }
.fv2-stage-info  { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.fv2-stage-name  { font-size: 0.875rem; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv2-stage-notes { font-size: 0.74rem; color: rgba(148,163,184,.58); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Incidents ───────────────────────────────────────────────────────────────── */
.fv2-incidents-list { display: flex; flex-direction: column; gap: 0.42rem; margin-top: 0.5rem; }
.fv2-incident-item {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(148,163,184,.09);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    transition: background .1s, border-color .1s;
}
.fv2-incident-item:hover { background: rgba(255,255,255,.05); border-color: rgba(148,163,184,.18); }

.fv2-inc-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    min-width: 0;
}
.fv2-incident-ref   { font-size: 0.84rem; font-weight: 600; color: #93c5fd; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv2-inc-ref-link   { color: inherit; text-decoration: none; }
.fv2-inc-ref-link:hover { text-decoration: underline; color: #60a5fa; }
.fv2-incident-notes { font-size: 0.75rem; color: rgba(148,163,184,.6); }
.fv2-incident-meta  { font-size: 0.68rem; color: rgba(148,163,184,.4); }
.fv2-inc-actions    { display: flex; gap: 0.25rem; flex-shrink: 0; margin-left: auto; }
.fv2-inc-actions .btn { padding: 0.15rem 0.38rem; font-size: 0.72rem; line-height: 1.4; }

/* Quick status select — visually styled like a badge */
.fv2-inc-status-sel {
    appearance: auto;
    border-radius: 20px;
    font-size: 0.67rem;
    font-weight: 600;
    padding: 0.16rem 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: opacity .15s;
    max-width: 11rem;
}
.fv2-inc-status-sel:hover { opacity: .85; }
.fv2-inc-status-sel:focus { outline: 2px solid rgba(96,165,250,.4); outline-offset: 1px; }

/* State colors shared between select and any leftover badge usage */
.fv2-inc-s--pendiente           { background: rgba(100,116,139,.22); color: #94a3b8;  border-color: rgba(100,116,139,.35); }
.fv2-inc-s--esperando-respuesta { background: rgba(234,179,8,.18);   color: #fde68a;  border-color: rgba(234,179,8,.35); }
.fv2-inc-s--en-proceso          { background: rgba(59,130,246,.18);  color: #93c5fd;  border-color: rgba(59,130,246,.35); }
.fv2-inc-s--solucionado         { background: rgba(74,222,128,.15);  color: #86efac;  border-color: rgba(74,222,128,.32); }

/* Native select option resets (can't style much cross-browser) */
.fv2-inc-status-sel option { background: #1e293b; color: #e2e8f0; }

.fv2-incident-add-form {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(148,163,184,.12);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Tasks */
.fv2-tasks-toolbar { display: flex; gap: 0.45rem; margin-bottom: 0.7rem; flex-wrap: wrap; align-items: center; }
.fv2-tasks-search-wrap { position: relative; flex: 1 1 180px; }
.fv2-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: rgba(148,163,184,.5);
    pointer-events: none;
}
.fv2-tasks-search {
    width: 100%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 7px;
    color: #e2e8f0;
    font-size: 0.82rem;
    padding: 0.38rem 0.75rem 0.38rem 2rem;
    outline: none;
    transition: border-color .15s;
}
.fv2-tasks-search:focus { border-color: rgba(96,165,250,.55); }
.fv2-tasks-filter { flex: 0 1 140px; min-width: 110px; }
.fv2-tasks-list  { display: flex; flex-direction: column; gap: 0.4rem; }
.fv2-task-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: rgba(148,163,184,.65);
    border-top: 1px solid rgba(255,255,255,.07);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* ── Comments (v2 modern) ─────────────────────────────────────────────────────── */
.fv2-tab-pane--comments { overflow: hidden; }
.fv2-comments-shell { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.fv2-comments-list-wrap { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 0.85rem 1rem 0.5rem; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.15) transparent; }

/* Comment card */
.fv2c-comment {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 0.4rem 0.6rem;
    margin-bottom: 1rem;
}
.fv2c-comment[data-depth="1"] { margin-left: 2rem; }
.fv2c-comment[data-depth="2"] { margin-left: 3.5rem; }
.fv2c-comment[data-depth="3"],
.fv2c-comment[data-depth="4"] { margin-left: 4.5rem; }
.fv2c-comment[data-depth="1"],
.fv2c-comment[data-depth="2"],
.fv2c-comment[data-depth="3"],
.fv2c-comment[data-depth="4"] {
    padding-left: 0.7rem;
    border-left: 2px solid rgba(99,102,241,.18);
}

.fv2c-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(99,102,241,.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 700; color: #a5b4fc;
    flex-shrink: 0; align-self: flex-start; margin-top: 3px;
    border: 1.5px solid rgba(99,102,241,.2);
    user-select: none;
}
.fv2c-avatar--mine { background: rgba(16,185,129,.2); color: #6ee7b7; border-color: rgba(16,185,129,.25); }

.fv2c-bubble {
    min-width: 0;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 2px 10px 10px 10px;
    padding: 0.55rem 0.7rem 0.45rem;
}
.fv2c-bubble--mine {
    background: rgba(16,185,129,.04);
    border-color: rgba(16,185,129,.12);
    border-radius: 10px 2px 10px 10px;
}

.fv2c-header {
    display: flex; align-items: center; gap: 0.45rem;
    margin-bottom: 0.3rem; flex-wrap: wrap;
}
.fv2c-author { font-size: 0.76rem; font-weight: 700; color: #e2e8f0; }
.fv2c-ts { font-size: 0.65rem; color: rgba(148,163,184,.45); margin-left: auto; white-space: nowrap; }
.fv2c-del-btn {
    background: none; border: none; color: rgba(148,163,184,.28);
    cursor: pointer; padding: 0 0.15rem; font-size: 0.7rem; line-height: 1;
    transition: color .12s; border-radius: 3px;
}
.fv2c-del-btn:hover { color: #f87171; background: rgba(248,113,113,.1); }

.fv2c-body {
    font-size: 0.85rem; color: rgba(203,213,225,.88);
    line-height: 1.6; word-break: break-word;
}
.fv2c-body p { margin: 0.2rem 0; }
.fv2c-body p:first-child { margin-top: 0; }
.fv2c-body p:last-child  { margin-bottom: 0; }
.fv2c-body a { color: #60a5fa; text-decoration: underline; }
.fv2c-body ul, .fv2c-body ol { padding-left: 1.2rem; margin: 0.2rem 0; }
.fv2c-body strong { color: #e2e8f0; }

.fv2c-footer { margin-top: 0.3rem; }
.fv2c-reply-btn {
    background: none; border: none; color: rgba(148,163,184,.38);
    font-size: 0.7rem; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; gap: 0.2rem;
    transition: color .12s;
}
.fv2c-reply-btn:hover { color: #60a5fa; }

.fv2c-children  { grid-column: 1 / -1; margin-top: 0.2rem; }
.fv2-reply-slot { grid-column: 2; min-width: 0; }

.fv2c-empty {
    text-align: center; padding: 2rem 1rem;
    color: rgba(148,163,184,.3); font-size: 0.82rem;
}
.fv2c-empty i { display: block; font-size: 1.8rem; margin-bottom: 0.45rem; opacity: .3; }

/* Inline reply form */
.fv2-reply-form {
    background: rgba(99,102,241,.06);
    border: 1px solid rgba(99,102,241,.18);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    margin-top: 0.3rem;
}
.fv2-reply-editor {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(148,163,184,.12);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    color: #e2e8f0; font-size: 0.84rem; line-height: 1.5;
    min-height: 34px; max-height: 120px; overflow-y: auto;
    outline: none; transition: border-color .15s;
    margin-bottom: 0.35rem;
}
.fv2-reply-editor:focus { border-color: rgba(99,102,241,.4); }
.fv2-reply-editor:empty::before { content: 'Escribí tu respuesta...'; color: rgba(148,163,184,.3); pointer-events: none; }
.fv2-reply-actions { display: flex; gap: 0.4rem; justify-content: flex-end; align-items: center; }
.fv2-reply-cancel {
    background: none; border: none; color: rgba(148,163,184,.45);
    font-size: 0.74rem; cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 4px;
    transition: color .12s;
}
.fv2-reply-cancel:hover { color: #e2e8f0; }

/* Composer */
.fv2-composer {
    flex-shrink: 0;
    padding: 0.65rem 0.9rem 0.75rem;
    background: rgba(10,16,30,.75);
    border-top: 1px solid rgba(255,255,255,.07);
}
.fv2-composer-toolbar {
    display: flex; gap: 0.12rem; align-items: center;
    margin-bottom: 0.45rem; flex-wrap: wrap;
}
.fv2-ctb-btn {
    background: none; border: 1px solid transparent;
    color: rgba(148,163,184,.55); cursor: pointer;
    padding: 0.2rem 0.4rem; border-radius: 4px;
    font-size: 0.76rem; transition: all .1s;
    display: inline-flex; align-items: center; gap: 0.2rem; min-height: 26px;
}
.fv2-ctb-btn:hover { background: rgba(255,255,255,.07); color: #e2e8f0; border-color: rgba(255,255,255,.12); }
.fv2-ctb-mention { color: #67e8f9; border-color: rgba(6,182,212,.25); background: rgba(6,182,212,.07); font-size: 0.74rem; }
.fv2-ctb-mention:hover { background: rgba(6,182,212,.18); border-color: rgba(6,182,212,.45); color: #a5f3fc; }
.fv2-ctb-mention span { font-size: 0.72rem; }
.fv2-ctb-ref { color: #a5b4fc; border-color: rgba(99,102,241,.25); background: rgba(99,102,241,.07); font-size: 0.74rem; }
.fv2-ctb-ref:hover { background: rgba(99,102,241,.18); border-color: rgba(99,102,241,.45); color: #c4b5fd; }
.fv2-ctb-ref span { font-size: 0.72rem; }
.fv2-ctb-sep { width: 1px; height: 14px; background: rgba(255,255,255,.1); margin: 0 0.1rem; flex-shrink: 0; }

.fv2-composer-editor {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(148,163,184,.15);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #e2e8f0; font-size: 0.87rem; line-height: 1.6;
    min-height: 52px; max-height: 180px; overflow-y: auto;
    outline: none; transition: border-color .15s;
    scrollbar-width: thin;
}
.fv2-composer-editor:focus { border-color: rgba(96,165,250,.4); }
.fv2-composer-editor:empty::before { content: attr(data-placeholder); color: rgba(148,163,184,.28); pointer-events: none; }
.fv2-composer-editor p { margin: 0.15rem 0; }

.fv2-composer-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 0.45rem; gap: 0.5rem; flex-wrap: wrap;
}
.fv2-composer-hint { font-size: 0.68rem; color: rgba(148,163,184,.35); }
.fv2-composer-hint kbd { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 3px; padding: 0.05rem 0.3rem; font-size: 0.62rem; color: #fff; }
.fv2-composer-actions { display: flex; gap: 0.55rem; align-items: center; }
.fv2-composer-meta { font-size: 0.72rem; color: rgba(148,163,184,.45); }

/* Reference chip (in editor + rendered in comments) */
.fv2-ref-chip {
    display: inline-flex; align-items: center; gap: 0.22rem;
    background: rgba(99,102,241,.14); border: 1px solid rgba(99,102,241,.28);
    color: #a5b4fc; border-radius: 20px;
    padding: 0.08rem 0.5rem 0.08rem 0.35rem;
    font-size: 0.78rem; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: background .12s, border-color .12s;
    user-select: none; vertical-align: middle;
}
.fv2-ref-chip:hover { background: rgba(99,102,241,.24); border-color: rgba(99,102,241,.5); color: #c4b5fd; }
.fv2-ref-chip[data-ref-type="task"]     { background: rgba(16,185,129,.1);  border-color: rgba(16,185,129,.3);  color: #6ee7b7; }
.fv2-ref-chip[data-ref-type="task"]:hover { background: rgba(16,185,129,.2); }
.fv2-ref-chip[data-ref-type="incident"] { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.28); color: #fcd34d; }
.fv2-ref-chip[data-ref-type="incident"]:hover { background: rgba(245,158,11,.2); }
.fv2-ref-chip[data-ref-type="doc"]      { background: rgba(139,92,246,.1);  border-color: rgba(139,92,246,.28); color: #c4b5fd; }
.fv2-ref-chip[data-ref-type="doc"]:hover { background: rgba(139,92,246,.2); }
.fv2-ref-chip i { font-size: 0.68rem; }

/* Reference picker dropdown */
.fv2-ref-picker {
    position: fixed; z-index: 1300;
    background: #1a2540; border: 1px solid rgba(255,255,255,.13);
    border-radius: 9px; padding: 0.3rem;
    min-width: 250px; max-width: 330px; max-height: 280px;
    overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.55);
    scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.18) transparent;
}
.fv2-ref-picker-empty { padding: 0.65rem 0.75rem; font-size: 0.78rem; color: rgba(148,163,184,.4); text-align: center; }
.fv2-ref-picker-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.42rem 0.6rem; border-radius: 6px;
    cursor: pointer; transition: background .1s;
}
.fv2-ref-picker-item:hover,
.fv2-ref-picker-item.active { background: rgba(99,102,241,.2); }
.fv2-ref-picker-item i { font-size: 0.82rem; flex-shrink: 0; width: 14px; }
.fv2-ref-picker-type { font-size: 0.62rem; color: rgba(148,163,184,.5); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; flex-shrink: 0; width: 54px; }
.fv2-ref-picker-label { font-size: 0.81rem; color: #e2e8f0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Highlight flash animation for navigation */
.fv2-highlight-flash { animation: fv2FlashAnim 1.5s ease-out forwards; }
@keyframes fv2FlashAnim {
    0%   { outline: 2px solid rgba(99,102,241,.9); outline-offset: 3px; box-shadow: 0 0 0 5px rgba(99,102,241,.2); }
    50%  { outline-color: rgba(99,102,241,.5); }
    100% { outline: 2px solid transparent; box-shadow: none; }
}

/* Modal footer */
.fv2-edit-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: rgba(10,16,30,.85);
    border-top: 1px solid rgba(148,163,184,.1);
    flex-shrink: 0;
}

/* ── Tags manager modal ──────────────────────────────────────────────────────── */
.fv2-tags-dialog { --bs-modal-width: min(580px, 96vw); }
.fv2-tags-modal { background: #0f172a; border: 1px solid rgba(255,255,255,.1); }
.fv2-tags-modal .modal-header { background: linear-gradient(135deg,#312e81,#4338ca); border-bottom: none; flex-shrink: 0; }
.fv2-tags-modal-body { padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }

/* Formulario crear/editar */
.fv2-tag-form {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 1rem;
    flex-shrink: 0;
}
.fv2-tag-form-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem 1rem;
    align-items: start;
}
.fv2-tag-form-main { display: flex; flex-direction: column; min-width: 0; }
.fv2-tag-form-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }

/* Lista de etiquetas existentes */
.fv2-tags-section { display: flex; flex-direction: column; gap: 0.5rem; }
.fv2-tags-section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.fv2-tags-list { display: flex; flex-direction: column; gap: 0.38rem; }
.fv2-tags-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.65rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 7px;
    min-width: 0;
    transition: background .1s, border-color .1s;
}
.fv2-tags-row:hover { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.13); }
.fv2-tag-preview {
    display: inline-flex;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.fv2-tags-row .text-muted { font-size: 0.72rem; white-space: nowrap; flex-shrink: 0; }
.fv2-tags-row .ms-auto { margin-left: auto; display: flex; gap: 0.3rem; flex-shrink: 0; }

/* Tags search */
.fv2-tags-search-wrap { position: relative; }
.fv2-tags-search-icon {
    position: absolute;
    left: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: rgba(148,163,184,.5);
    pointer-events: none;
}
.fv2-tags-search-input {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.8rem;
    padding: 0.3rem 0.65rem 0.3rem 1.75rem;
    outline: none;
    width: 160px;
    transition: border-color .15s;
}
.fv2-tags-search-input:focus { border-color: rgba(96,165,250,.5); outline: none; }
.fv2-tags-search-input::placeholder { color: rgba(148,163,184,.4); }

/* Mobile: apilar el formulario en una sola columna */
@media (max-width: 479.98px) {
    .fv2-tag-form-grid { grid-template-columns: 1fr; }
    .fv2-tags-search-input { width: 120px; }
}

/* Color palette (same as cal-color-palette) */
.fv2-color-picker-wrap { display: flex; flex-direction: column; gap: 0.4rem; }
.fv2-color-palette { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.fv2-color-swatch {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15);
    background: var(--sc, rgba(255,255,255,.12));
    cursor: pointer;
    padding: 0;
    transition: transform .12s ease, border-color .12s, box-shadow .12s;
    flex-shrink: 0;
    outline: none;
}
.fv2-color-swatch:hover { transform: translateY(-2px) scale(1.12); border-color: rgba(255,255,255,.55); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.fv2-color-swatch.is-active { border-color: #f8f9fa; box-shadow: 0 0 0 2px rgba(99,102,241,.55); transform: scale(1.1); }

.fv2-color-custom-input {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.2);
    background: transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.fv2-color-custom-label { font-size: 0.74rem; color: rgba(148,163,184,.6); }

/* Dark form controls */
.fv2-edit-modal .form-control,
.fv2-edit-modal .form-select,
.fv2-tags-modal .form-control,
.fv2-tags-modal .form-select {
    background-color: rgba(15,23,42,.95);
    border: 1px solid rgba(148,163,184,.18);
    color: #e2e8f0;
    border-radius: 7px;
    font-size: 0.875rem;
}
.fv2-edit-modal .form-select,
.fv2-tags-modal .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 14px 10px;
    padding-right: 2rem;
}
.fv2-edit-modal .form-control:focus,
.fv2-edit-modal .form-select:focus {
    border-color: rgba(96,165,250,.55);
    box-shadow: 0 0 0 2px rgba(59,130,246,.12);
    color: #f1f5f9;
}
.fv2-edit-modal .form-label { font-size: 0.8rem; color: rgba(203,213,225,.78); font-weight: 500; margin-bottom: 0.28rem; }
.fv2-edit-modal .form-control::placeholder { color: rgba(148,163,184,.38); }

/* ── Spinner / loading buttons ───────────────────────────────────────────────── */
.fv2-save-btn .fv2-btn-loading,
.fv2-create-submit .fv2-btn-loading { display: flex; align-items: center; gap: 0.35rem; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */

/* 768px–991px: tablet — 4 columnas, ocultar "Creado", reasignar posiciones */
@media (min-width: 768px) and (max-width: 991.98px) {
    :root { --fv2-cols: 146px 1fr 104px auto; }
    .fv2-col--created { display: none; }
    .fv2-cols-header .fv2-col--created { display: none; }
    .fv2-col--publish { grid-column: 3; }
    .fv2-col--actions { grid-column: 4; }

    /* Edit modal: reducir padding y espaciado en pantallas medianas */
    .fv2-pane-scroll { padding: 1rem; }
    .fv2-form-section { padding: .85rem .95rem; }
    .fv2-edit-header { padding: 0.65rem 1rem; }
}

/* ≤ 767px: mobile — vista card apilada, sidebar a 100% */
@media (max-width: 767.98px) {

    :root { --fv2-cols: 1fr auto; }

    .fv2-layout { flex-direction: column; border-radius: 8px; }

    .fv2-sidebar.dt-sidebar { width: 100% !important; transition: none; border-right: none; border-bottom: 1px solid rgba(148,163,184,.12); }
    .fv2-sidebar.dt-sidebar.is-collapsed { height: 0; overflow: hidden; }

    .fv2-cols-header { display: none; }

    .fv2-row {
        grid-template-columns: 1fr auto;
        padding: 0;
        min-height: 0;
        align-items: start;
    }

    .fv2-col--status  { grid-column: 1; grid-row: 1; padding: 0.55rem 0.7rem 0.12rem; }
    .fv2-col--name    { grid-column: 1; grid-row: 2; padding: 0.1rem 0.7rem 0.15rem; }
    .fv2-col--publish { grid-column: 1; grid-row: 3; padding: 0 0.7rem 0.55rem; }
    .fv2-col--created { display: none; }
    .fv2-col--actions { grid-column: 2; grid-row: 1 / 4; align-self: stretch; display: flex; align-items: center; padding: 0 0.55rem; flex-wrap: nowrap; }

    .fv2-edit-header   { padding: 0.6rem 1rem; }
    .fv2-edit-title    { max-width: 160px; font-size: 0.9rem; }
    .fv2-edit-meta     { display: none; }
    .fv2-edit-tab span:not(.fv2-tab-badge) { display: none; }
    .fv2-edit-tab { padding: 0.58rem 0.7rem; }

    .fv2-pane-scroll   { padding: 0.85rem; }
    .fv2-audit-grid    { grid-template-columns: 1fr; }
    .fv2-stages-header { flex-direction: column; align-items: stretch; }
    .fv2-tasks-toolbar { flex-direction: column; }
    .fv2-tasks-filter  { flex: 1 1 auto; width: 100%; }
    .fv2-form-grid     { gap: 0.85rem; }
    .fv2-docs-sidebar  { width: 160px; }
    .fv2-doc-title-actions .fv2-doc-clone-btn,
    .fv2-doc-title-actions .fv2-doc-delete-btn { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DOCTRACKER V2 — 3-column layout: status | name+meta | actions
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Tab pane height (same pattern as #pills-forms) */
#pills-doctracker {
    flex-direction: column;
    height: calc(100vh - 110px);
    overflow: hidden;
}
#pills-doctracker.show.active {
    display: flex !important;
    height: calc(100vh - 110px) !important;
    min-height: 0;
    overflow: hidden;
}
#pills-doctracker > .tab-section-header {
    position: static;
    top: unset;
}

/* Layout uses same fv2-layout + dt-sidebar combination */
#pills-doctracker .fv2-layout {
    flex: 1 1 auto;
    min-height: 0;
}

/* ── 3-column grid: status (auto) | main (number+meta) | actions ────────────── */
:root {
    --dtv-cols: max-content 1fr max-content;
}

.dtv-cols-header {
    display: grid;
    grid-template-columns: var(--dtv-cols);
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    flex: 0 0 auto;
}
.dtv-cols-header .fv2-col { padding: 0 0.4rem; }

.dtv-col--status  { grid-column: 1; }
/* header cell keeps row-direction (default flex); row cell stacks vertically */
.dtv-col--main    { grid-column: 2; min-width: 0; }
.dtv-row .dtv-col--main { flex-direction: column; align-items: flex-start; gap: 0.08rem; }
.dtv-col--actions {
    grid-column: 3;
    display: flex;
    gap: 0.22rem;
    justify-content: flex-end;
    padding-right: 0.25rem;
    flex-wrap: nowrap;
    align-items: center;
}

/* ── DocTracker row ──────────────────────────────────────────────────────────── */
.dtv-row {
    display: grid;
    grid-template-columns: var(--dtv-cols);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    margin: 0 0.5rem 0.28rem;
    align-items: center;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.018);
    transition: background 0.12s, border-color 0.12s;
}
.dtv-row:hover {
    background: rgba(255, 255, 255, 0.038);
    border-color: rgba(148, 163, 184, 0.22);
}
.dtv-row.is-selected {
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}
.dtv-row.is-highlighted { animation: fv2Hl 2.2s ease-out; }
.dtv-row--deleting { opacity: 0.4; pointer-events: none; }
.dtv-row .fv2-col { padding: 0.38rem 0.4rem; min-width: 0; }

/* ── Number button (always full, no truncation) ─────────────────────────────── */
.dtv-name-btn {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.12s;
    display: block;
    width: auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dtv-name-btn:hover { color: #93c5fd; }

/* ── Meta sub-line: assigned + date + obs ───────────────────────────────────── */
.dtv-doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.65rem;
}

.dtv-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.71rem;
    color: rgba(148, 163, 184, 0.62);
    white-space: nowrap;
}
.dtv-meta-chip i { font-size: 0.63rem; flex-shrink: 0; }
.dtv-meta-chip--obs { color: rgba(148, 163, 184, 0.48); }

/* ── memoFullModal — fv2 edit-modal style ────────────────────────────────────── */
#memoFullModal .modal-header { padding: 0; border-bottom: none; }
#memoFullModal .fv2-edit-header { padding: 0.8rem 1.25rem; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
/* Mobile: obs chip hidden, sidebar collapses */
@media (max-width: 767.98px) {
    .dtv-meta-chip--obs { display: none; }
    #pills-doctracker .fv2-layout { flex-direction: column; border-radius: 8px; }
    #pills-doctracker .dt-sidebar.fv2-sidebar { width: 100% !important; transition: none; border-right: none; border-bottom: 1px solid rgba(148,163,184,.12); }
    #pills-doctracker .dt-sidebar.fv2-sidebar.is-collapsed { height: 0; overflow: hidden; }
    .dtv-cols-header { display: none; }
    .dtv-row .fv2-col { padding: 0.38rem 0.55rem; }
}

/* ── Período de activación — badge en la lista ───────────────────────────────── */
.fv2-period-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.1rem 0.42rem;
    border-radius: 20px;
    white-space: nowrap;
}
.fv2-period-badge--active   { background: rgba(74,222,128,.15); color: #4ade80; border: 1px solid rgba(74,222,128,.3); }
.fv2-period-badge--upcoming { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.28); }
.fv2-period-badge--ended    { background: rgba(148,163,184,.1); color: rgba(148,163,184,.6); border: 1px solid rgba(148,163,184,.2); }

/* ── Modal de perfil ─────────────────────────────────────────────────────────── */
.profile-modal { max-width: 440px; }

.profile-modal .modal-content {
    background: #0b1120;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    color: #e2e8f0;
    overflow: hidden;
}

/* Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.25rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    flex-shrink: 0;
}
.profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    border: 2px solid rgba(255,255,255,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.profile-header-info { min-width: 0; flex: 1; }
.profile-display-name {
    color: #fff;
    font-size: 0.97rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-display-username {
    color: rgba(191,219,254,.7);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.1rem;
}
.profile-display-username .bi-at { font-size: 0.8rem; }

/* Loading */
.profile-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}

/* Tabs */
.profile-tabs-wrap {
    background: rgba(10,16,30,.6);
    border-bottom: 1px solid rgba(148,163,184,.1);
    padding: 0 1rem;
}
.profile-tabs {
    display: flex;
    gap: 0;
    border: none;
}
.profile-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.85rem;
    color: rgba(148,163,184,.65);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color .12s, border-color .12s;
    background: none;
}
.profile-tabs .nav-link:hover  { color: #e2e8f0; }
.profile-tabs .nav-link.active { color: #60a5fa; border-bottom-color: #3b82f6; }
.profile-tabs .nav-link .bi   { font-size: 0.88rem; }

/* Tab content */
.profile-tab-content { padding: 1.1rem 1.25rem; }

/* Field groups */
.profile-field-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.profile-field {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}
.profile-field-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(148,163,184,.6);
}
.profile-field-label .bi { font-size: 0.82rem; }
.profile-field-hint {
    font-size: 0.73rem;
    color: rgba(148,163,184,.45);
    margin-top: 0.18rem;
}

/* Inputs */
.profile-input {
    background: rgba(255,255,255,.05) !important;
    border-color: rgba(148,163,184,.2) !important;
    color: #f1f5f9 !important;
    font-size: 0.85rem;
}
.profile-input:focus {
    background: rgba(255,255,255,.08) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59,130,246,.22) !important;
    color: #f1f5f9 !important;
}
.profile-input::placeholder { color: rgba(148,163,184,.35) !important; }
.profile-input option { background: #0f172a; color: #e2e8f0; }

/* Password toggle */
.profile-pass-wrap {
    position: relative;
}
.profile-pass-wrap .profile-input { padding-right: 2.4rem; }
.profile-pass-toggle {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(148,163,184,.5);
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    transition: color .12s;
}
.profile-pass-toggle:hover { color: #94a3b8; }

/* Toggle row */
.profile-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.profile-toggle-row .form-check-input {
    width: 2.2em;
    height: 1.2em;
    cursor: pointer;
}

/* Hint text */
.profile-hint-text {
    font-size: 0.73rem;
    color: rgba(148,163,184,.45);
    margin: 0.25rem 0 0;
}

/* Footer */
.profile-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(10,16,30,.7);
    border-top: 1px solid rgba(148,163,184,.1);
}

/* Nivelar componentes Bootstrap al dark theme del modal */
.profile-modal .btn-outline-secondary {
    color: rgba(148,163,184,.7);
    border-color: rgba(148,163,184,.25);
}
.profile-modal .btn-outline-secondary:hover {
    background: rgba(148,163,184,.1);
    color: #e2e8f0;
    border-color: rgba(148,163,184,.4);
}
.profile-modal .form-check-input {
    background-color: rgba(255,255,255,.06);
    border-color: rgba(148,163,184,.3);
}
.profile-modal .form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}
.profile-modal .form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(59,130,246,.25);
    border-color: #3b82f6;
}

/* ── Notification bell ───────────────────────────────────────────────────────── */
.app-notif-btn {
    position: relative;
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    font-size: 1.15rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    transition: color .15s;
    margin-right: 0.5rem;
}
.app-notif-btn:hover { color: #fff; }
.app-notif-badge {
    position: absolute;
    top: 0; right: 0;
    background: #ef4444;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}
.app-notif-dropdown {
    min-width: 300px;
    background: #0f172a;
    border: 1px solid rgba(148,163,184,.15);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
    padding: 0;
    overflow: hidden;
}
.app-notif-header {
    padding: 0.6rem 0.9rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(148,163,184,.6);
    border-bottom: 1px solid rgba(148,163,184,.1);
}
.app-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid rgba(148,163,184,.07);
    cursor: default;
    transition: background .1s;
}
.app-notif-item:hover { background: rgba(255,255,255,.03); }
.app-notif-item--new  { background: rgba(59,130,246,.06); }
.app-notif-icon { font-size: 1rem; margin-top: 0.05rem; }
.app-notif-icon--start { color: #4ade80; }
.app-notif-icon--end   { color: #f87171; }
.app-notif-body { flex: 1; min-width: 0; }
.app-notif-title { font-size: 0.8rem; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-notif-sub   { font-size: 0.7rem; color: rgba(148,163,184,.6); margin-top: 0.1rem; }
.app-notif-dismiss {
    background: none;
    border: none;
    color: rgba(148,163,184,.4);
    font-size: 0.75rem;
    padding: 0;
    cursor: pointer;
    transition: color .12s;
    flex-shrink: 0;
}
.app-notif-dismiss:hover { color: #f87171; }
.app-notif-empty { padding: 1rem 0.9rem; font-size: 0.8rem; color: rgba(148,163,184,.5); text-align: center; }

/* ── User dropdown en navbar ─────────────────────────────────────────────────── */
.app-user-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #e2e8f0;
    font-size: 0.82rem;
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background .15s;
}
.app-user-btn:hover, .app-user-btn:focus { background: rgba(255,255,255,.14); color: #fff; }
.app-user-btn::after { margin-left: 0.2rem; }
.app-user-dropdown {
    background: #0f172a;
    border: 1px solid rgba(148,163,184,.15);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,.4);
    min-width: 180px;
}
.app-user-dropdown .dropdown-item {
    color: #cbd5e1;
    font-size: 0.82rem;
    padding: 0.5rem 0.9rem;
}
.app-user-dropdown .dropdown-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-user-dropdown .dropdown-item.text-danger { color: #f87171 !important; }
.app-user-dropdown .dropdown-item.text-danger:hover { background: rgba(248,113,113,.08); }
.app-user-dropdown .dropdown-divider { border-color: rgba(148,163,184,.12); }

/* ── Doc export dropdown ─────────────────────────────────────────────────────── */
.fv2-doc-export-btn { padding: 0.2rem 0.42rem; font-size: 0.72rem; }
.fv2-doc-export-menu {
    background: #1a2540;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 0.3rem;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.fv2-doc-export-menu .dropdown-item {
    color: #cbd5e1;
    font-size: 0.82rem;
    border-radius: 5px;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.fv2-doc-export-menu .dropdown-item:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.fv2-doc-export-menu .dropdown-item i { font-size: 0.9rem; opacity: .75; }

/* ── Publication periods list ────────────────────────────────────────────────── */
.fv2-periods-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.fv2-period-item {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.fv2-period-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.fv2-period-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: .03em;
}

.fv2-period-del {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.4;
    border-color: rgba(248,113,113,.4);
    color: #f87171;
}
.fv2-period-del:hover { background: rgba(248,113,113,.12); border-color: #f87171; color: #fca5a5; }

.fv2-period-field-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.fv2-periods-loading {
    padding: 0.5rem 0;
    display: block;
}

/* ── Quick-status selects (shared base: stages, incidents, tasks) ────────────── */
.fv2-qs-sel {
    appearance: auto;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.67rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 0.16rem 0.55rem 0.16rem 0.45rem;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: opacity .12s, box-shadow .12s;
}
.fv2-qs-sel:hover { opacity: .82; }
.fv2-qs-sel:focus { outline: 2px solid rgba(96,165,250,.45); outline-offset: 1px; }
.fv2-qs-sel option { background: #1e293b; color: #e2e8f0; font-weight: 500; }

/* Stage selects: piggyback on existing badge-status-* colors from main.css */
/* The select gets class "fv2-qs-sel badge badge-status-*" so colors come for free */

/* Task status colors (pending/in_progress/waiting/completed/cancelled) */
.fv2-ts--pending     { background: rgba(100,116,139,.22); color: #94a3b8;  border-color: rgba(100,116,139,.35); }
.fv2-ts--in-progress { background: rgba(59,130,246,.2);   color: #93c5fd;  border-color: rgba(59,130,246,.38); }
.fv2-ts--waiting     { background: rgba(234,179,8,.18);   color: #fde68a;  border-color: rgba(234,179,8,.35); }
.fv2-ts--completed   { background: rgba(74,222,128,.16);  color: #86efac;  border-color: rgba(74,222,128,.32); }
.fv2-ts--cancelled   { background: rgba(148,163,184,.12); color: #94a3b8;  border-color: rgba(148,163,184,.25); text-decoration: line-through; }

/* ── formTasksModal dark theme ───────────────────────────────────────────────── */
.fv2-tasks-modal-content { background: #0b1120; border: 1px solid rgba(255,255,255,.08); }
.fv2-tasks-modal-header  { background: linear-gradient(135deg,#0f172a,#1e3a5f); border-bottom: 1px solid rgba(255,255,255,.08); padding: 0.85rem 1.2rem; }
.fv2-tasks-modal-body    { background: #0d1526; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.fv2-tasks-modal-toolbar { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.fv2-tasks-all-list      { display: flex; flex-direction: column; gap: 0.4rem; }

/* Stage card QoL tweak: more comfortable height */
.fv2-stage-card { min-height: 46px; }
.fv2-stage-right .fv2-qs-sel { max-width: 9rem; }

/* Task card: wider status select */
.forms-task-card-meta .fv2-qs-sel { max-width: 10rem; }

/* ── Quick-status selects (shared base: stages, incidents, tasks) ────────────── */
.fv2-qs-sel {
    appearance: auto;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.67rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 0.16rem 0.55rem 0.16rem 0.45rem;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: opacity .12s, box-shadow .12s;
}
.fv2-qs-sel:hover { opacity: .82; }
.fv2-qs-sel:focus { outline: 2px solid rgba(96,165,250,.45); outline-offset: 1px; }
.fv2-qs-sel option { background: #1e293b; color: #e2e8f0; font-weight: 500; }

/* Stage selects: piggyback on existing badge-status-* colors from main.css */
/* The select gets class "fv2-qs-sel badge badge-status-*" so colors come for free */

/* Task status colors (pending/in_progress/waiting/completed/cancelled) */
.fv2-ts--pending     { background: rgba(100,116,139,.22); color: #94a3b8;  border-color: rgba(100,116,139,.35); }
.fv2-ts--in-progress { background: rgba(59,130,246,.2);   color: #93c5fd;  border-color: rgba(59,130,246,.38); }
.fv2-ts--waiting     { background: rgba(234,179,8,.18);   color: #fde68a;  border-color: rgba(234,179,8,.35); }
.fv2-ts--completed   { background: rgba(74,222,128,.16);  color: #86efac;  border-color: rgba(74,222,128,.32); }
.fv2-ts--cancelled   { background: rgba(148,163,184,.12); color: #94a3b8;  border-color: rgba(148,163,184,.25); text-decoration: line-through; }

/* ── formTasksModal dark theme ───────────────────────────────────────────────── */
.fv2-tasks-modal-content { background: #0b1120; border: 1px solid rgba(255,255,255,.08); }
.fv2-tasks-modal-header  { background: linear-gradient(135deg,#0f172a,#1e3a5f); border-bottom: 1px solid rgba(255,255,255,.08); padding: 0.85rem 1.2rem; }
.fv2-tasks-modal-body    { background: #0d1526; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.fv2-tasks-modal-toolbar { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.fv2-tasks-all-list      { display: flex; flex-direction: column; gap: 0.4rem; }

/* Stage card: more comfortable height */
.fv2-stage-card { min-height: 46px; }
.fv2-stage-right .fv2-qs-sel { max-width: 9.5rem; }

/* Task card: wider status select */
.forms-task-card-meta .fv2-qs-sel { max-width: 10rem; }

/* ── formTasksModal: overlay de refresh + tarea activa ───────────────────────── */
.fv2-tasks-all-list { position: relative; }

.aft-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,21,38,.65);
    display: flex;
    align-items: flex-start;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
    z-index: 2;
    border-radius: 6px;
    pointer-events: none;
}

.forms-task-card.is-active {
    border-color: rgba(59,130,246,.5) !important;
    background: rgba(59,130,246,.07) !important;
}

/* ── formTasksModal toolbar rediseñada ───────────────────────────────────────── */
.fv2-tasks-modal-toolbar { display: flex; flex-direction: column; gap: 0.5rem; }

.aft-toolbar-top {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}
.aft-search { flex: 1 1 200px; min-width: 140px; }
.aft-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }

.aft-toolbar-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}
.aft-filter-sel {
    flex: 1 1 130px;
    min-width: 110px;
    max-width: 200px;
}
.aft-clear-btn {
    color: rgba(148,163,184,.65);
    font-size: 0.78rem;
    padding: 0.22rem 0.5rem;
    flex-shrink: 0;
    text-decoration: none;
}
.aft-clear-btn:hover { color: #f87171; }

/* Highlight active filters */
.aft-filter-sel:not([value='all']) option:checked,
.aft-filter-sel.has-value { border-color: rgba(96,165,250,.55); }

/* ── formTasksModal: layout con sidebar colapsable (mismo patron dt-sidebar) ──── */
.fv2-tasks-modal-body {
    padding: 0;
    gap: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Barra superior */
.aft-toolbar {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    background: #0d1526;
}
.aft-search { flex: 1 1 180px; min-width: 120px; }

/* Boton filtros: mismo estilo que cal-hdr-btn */
.aft-filter-btn { transition: background .12s, color .12s, border-color .12s; }
.aft-filter-btn.active {
    background: rgba(96,165,250,.16);
    border-color: rgba(96,165,250,.45);
    color: #93c5fd;
}

/* Layout principal */
.aft-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Sidebar colapsable — hereda dt-sidebar */
.aft-sidebar.dt-sidebar {
    border-right: 1px solid rgba(255,255,255,.07);
    background: #0a1120;
    overflow: hidden;
    transition: width .22s cubic-bezier(.4,0,.2,1);
}
.aft-sidebar.dt-sidebar .dt-sidebar-body {
    padding: 0.85rem 0.9rem;
}

/* Area principal de la lista */
.aft-main {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.18) transparent;
}
.fv2-tasks-all-list { display: flex; flex-direction: column; gap: 0.4rem; }

/* Mobile: sidebar colapsa verticalmente */
@media (max-width: 767.98px) {
    .aft-layout { flex-direction: column; }
    .aft-sidebar.dt-sidebar { width: 100% !important; max-height: 280px; border-right: none; border-bottom: 1px solid rgba(255,255,255,.07); }
    .aft-sidebar.dt-sidebar.is-collapsed { max-height: 0; }
    .aft-toolbar { padding: 0.6rem 0.75rem; }
}

/* Dot indicator en el boton filtros cuando hay filtros activos */
.aft-filter-btn { position: relative; }
.aft-filter-dot {
    position: absolute;
    top: 3px; right: 3px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #60a5fa;
    pointer-events: none;
}

/* ── Editor de documentos: mejoras QoL ───────────────────────────────────────── */

/* Botón activo (bold, italic, etc. cuando el cursor está dentro) */
.fv2-doc-btn.is-active,
.fv2-bubble-btn.is-active {
    background: rgba(99,102,241,.22);
    border-color: rgba(99,102,241,.45);
    color: #a5b4fc;
}

/* Grupos de botones en el toolbar de tabla */
.fv2-tbl-group { display: inline-flex; gap: 0.08rem; }

/* Handle de arrastre en el toolbar de tabla */
.fv2-table-toolbar-handle {
    color: rgba(148,163,184,.5);
    font-size: 0.85rem;
    cursor: grab;
    padding: 0.18rem 0.3rem;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
}
.fv2-table-toolbar-handle:hover { color: #94a3b8; background: rgba(255,255,255,.08); }
.fv2-table-toolbar-handle:active { cursor: grabbing; }

/* Tabla toolbar: layout más compacto */
.fv2-table-toolbar { gap: 0.08rem; padding: 0.22rem 0.45rem; box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.fv2-tbl-btn { padding: 0.2rem 0.38rem; font-size: 0.78rem; min-height: 24px; }

/* Tabla drag: resaltar tabla al pasar el mouse sobre el handler */
.fv2-doc-editor table.fv2-tbl-active { outline: 2px solid rgba(99,102,241,.4); }

/* Selection bubble: más compacto y con separadores limpios */
.fv2-selection-bubble { box-shadow: 0 4px 16px rgba(0,0,0,.55); }
.fv2-bubble-sep { width: 1px; height: 14px; background: rgba(148,163,184,.2); margin: 0 0.1rem; }

/* ── Table drag indicator ─────────────────────────────────────────────────────── */
.fv2-drop-indicator {
    position: fixed;
    height: 2px;
    background: #6366f1;
    border-radius: 2px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(99,102,241,.7);
    transition: top .05s;
}
.fv2-drop-indicator::before {
    content: '';
    position: absolute;
    left: -4px; top: -4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #6366f1;
}

/* Tabla siendo arrastrada */
.fv2-doc-editor table.fv2-tbl-dragging {
    opacity: 0.35;
    outline: 2px dashed rgba(99,102,241,.5);
}
/* Calls-specific styles moved to resources/css/calls.css */
