/* ============================================================================
   VIIZOR MODAL — el lenguaje visual único de todos los modales de la app.

   Extraído del modal de Cloud Contour Lines, que es la referencia aprobada:
   tarjeta pizarra (#1e293b), acento naranja (#f59e0b), título con ícono y
   subrayado naranja, campos oscuros (#0f172a), botón primario naranja.

   REGLA: ningún modal define colores propios. Si algo falta acá, se agrega
   acá, no en el modal. Así se terminó la ensalada de cuatro familias
   visuales (#2a2a2a, rgba(26,26,26), gradientes, #1e1e2e…) que había antes.
   ============================================================================ */

/* --- Capa de fondo -------------------------------------------------------- */
.vz-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

/* --- Tarjeta --------------------------------------------------------------- */
.vz-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 380px;          /* ancho de la referencia; .vz-card--wide amplía */
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    color: #e5e7eb;
    color-scheme: dark;        /* selects, checkboxes y radios nativos oscuros */
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    user-select: none;         /* los textos de UI no se seleccionan (pedido repetido) */
}
.vz-card input, .vz-card textarea { user-select: text; }
.vz-card::-webkit-scrollbar { display: none; }
.vz-card--wide  { max-width: 560px; }
.vz-card--xwide { max-width: 720px; }

/* Alto fijo: la ventana no crece ni se achica según lo que se muestre adentro.
   Un modal que salta de tamaño cada vez que cambia el contenido —y que además
   se re-centra— es imposible de usar. Lo que scrollea es el panel de adentro. */
.vz-card--tall { height: 78vh; max-height: 78vh; overflow: hidden; }
.vz-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vz-pane-fixed { flex: none; }

/* --- Título ---------------------------------------------------------------- */
.vz-title {
    margin: 0 0 16px 0;
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #f59e0b;
    padding-bottom: 10px;
}
.vz-title i, .vz-title svg { width: 20px; height: 20px; color: #f59e0b; }
.vz-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: -10px 0 14px 0;
}

/* --- Etiquetas y secciones -------------------------------------------------- */
.vz-label {
    display: block;
    margin-bottom: 5px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
}
.vz-hint { font-size: 11px; color: #64748b; }
.vz-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 14px;
}
.vz-row { display: flex; gap: 8px; margin-bottom: 14px; }
.vz-row > * { flex: 1; min-width: 0; }

/* --- Campos ------------------------------------------------------------------ */
.vz-input, .vz-select {
    width: 100%;
    padding: 6px 8px;
    background: #0f172a;
    color: #e5e7eb;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    box-sizing: border-box;
}
.vz-input:focus, .vz-select:focus { outline: none; border-color: #f59e0b; }
.vz-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #e5e7eb;
}
.vz-check input[type="checkbox"],
.vz-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #f59e0b;
}

/* Stepper (− valor +), como en la referencia */
.vz-spin {
    display: flex;
    align-items: center;
    border: 1px solid #475569;
    border-radius: 6px;
    overflow: hidden;
}
.vz-spin input {
    flex: 1;
    min-width: 0;
    padding: 6px 2px;
    background: #0f172a;
    color: #e5e7eb;
    border: none;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
}
.vz-spin input::-webkit-inner-spin-button,
.vz-spin input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.vz-spin button {
    width: 28px;
    height: 28px;
    background: #334155;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
    transition: background 0.15s;
}
.vz-spin button:first-child { border-right: 1px solid #475569; }
.vz-spin button:last-child  { border-left: 1px solid #475569; }
.vz-spin button:hover  { background: #475569; color: #fff; }
.vz-spin button:active { background: #f59e0b; color: #000; }

/* --- Dropdown propio (reemplaza <select> nativo) ------------------------------- */
.vz-dd { position: relative; width: 100%; }
.vz-dd-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: #0f172a;
    color: #e5e7eb;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    text-align: left;
    transition: border-color 0.15s;
}
.vz-dd-trigger:hover { border-color: #64748b; }
.vz-dd--compact .vz-dd-trigger { padding: 4px 8px; font-size: 12px; }
.vz-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-dd-chev { color: #f59e0b; font-size: 11px; flex: none; }
.vz-dd-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
    max-height: 220px;
    overflow-y: auto;
}
.vz-dd-panel--open { display: block; }
.vz-dd-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
    cursor: pointer;
    white-space: nowrap;
}
.vz-dd-opt:hover { background: rgba(245, 158, 11, 0.15); }
.vz-dd-opt--sel { color: #f59e0b; }
.vz-dd-hint { font-size: 10px; font-weight: 400; color: #64748b; overflow: hidden; text-overflow: ellipsis; }

/* --- Chips excluyentes (pocas opciones, sin dropdown) --------------------------- */
.vz-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.vz-chip {
    padding: 5px 12px;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.vz-chip:hover { border-color: #64748b; color: #fff; }
.vz-chip--on { background: rgba(245, 158, 11, 0.15); border-color: #f59e0b; color: #f59e0b; }

/* --- Botones ------------------------------------------------------------------ */
.vz-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}
.vz-btn {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    background: #334155;
    border: none;
    color: #cbd5e1;
    transition: background 0.15s;
}
.vz-btn:hover { background: #475569; color: #fff; }
.vz-btn--primary { background: #f59e0b; color: #0f172a; }
.vz-btn--primary:hover { background: #fbbf24; color: #0f172a; }
.vz-btn--danger { background: #ef4444; color: #fff; }
.vz-btn--danger:hover { background: #f87171; }
.vz-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* --- Pestañas dentro de un modal ------------------------------------------------ */
.vz-tabs { display: flex; gap: 16px; margin-bottom: 12px; }
.vz-tab {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 2px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.vz-tab:hover { color: #cbd5e1; }
.vz-tab--on { color: #e5e7eb; border-bottom-color: #f59e0b; }

/* --- Tarjetas de cifra (el número que el usuario vino a ver) --------------------- */
.vz-stats { display: flex; gap: 10px; margin-bottom: 8px; }
.vz-stat {
    flex: 1;
    min-width: 0;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 6px 12px;
}
.vz-stat-label {
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.vz-stat-value { color: #e5e7eb; font-size: 21px; font-weight: 700; line-height: 1.25; }
.vz-stat-value--bad { color: #ef4444; }
.vz-stat-value--ok  { color: #22c55e; }

/* --- Lista de filas con valor a la derecha --------------------------------------- */
/* Panel que scrollea sin barra a la vista (igual que la tarjeta del modal). */
.vz-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.vz-scroll::-webkit-scrollbar { display: none; }
.vz-group-head { display: flex; align-items: baseline; margin: 8px 0 4px; }
.vz-group-title { color: #cbd5e1; font-size: 12.5px; font-weight: 600; }
.vz-group-actions { margin-left: auto; display: flex; gap: 10px; }
.vz-link { background: none; border: none; color: #f59e0b; font-size: 12px; cursor: pointer; padding: 0; }
.vz-link--mute { color: #94a3b8; }
.vz-link:hover { text-decoration: underline; }

.vz-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 9px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    line-height: 1.35;
}
.vz-item + .vz-item { margin-top: 2px; }
.vz-item--pick { cursor: pointer; }
.vz-item--pick:hover { background: rgba(255, 255, 255, 0.09); }
.vz-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #f59e0b;
    flex: none;
    cursor: pointer;
}
.vz-item-main { min-width: 0; flex: 1; }
.vz-item-name, .vz-item-note {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vz-item-name { color: #e5e7eb; font-size: 13px; }
.vz-item-note { color: #94a3b8; font-size: 11.5px; }
.vz-item-value {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;   /* las cifras no bailan al alinearse */
}
.vz-item-value--bad  { color: #ef4444; }
.vz-item-value--mute { color: #64748b; }

/* --- Árbol de carpetas ----------------------------------------------------------- */
.vz-intro { color: #94a3b8; font-size: 12px; line-height: 1.4; margin-bottom: 7px; }
.vz-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.vz-legend > span { display: flex; align-items: center; gap: 6px; color: #94a3b8; font-size: 11.5px; }

.vz-twisty {
    width: 14px;
    flex: none;
    text-align: center;
    color: #94a3b8;
    font-size: 9px;
    cursor: pointer;
    user-select: none;
}
.vz-item--head { background: rgba(255, 255, 255, 0.08); cursor: pointer; }
.vz-item--head:hover { background: rgba(255, 255, 255, 0.12); }
.vz-item--head .vz-item-name { font-weight: 600; }
.vz-children { margin: 3px 0 3px 7px; padding-left: 9px; border-left: 1px solid #334155; }
.vz-children[hidden] { display: none; }
.vz-item-tag {
    flex: none;
    font-size: 9.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}
.vz-item-tag--keep { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.vz-item-tag--drop { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.vz-item-tag--fix  { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Punto de estado al principio de una fila */
.vz-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.vz-dot--ok   { background: #22c55e; }
.vz-dot--warn { background: #f59e0b; }
.vz-dot--bad  { background: #ef4444; }
.vz-dot--mute { background: #64748b; }

/* --- Estados de una lista (cargando / vacío / error) ----------------------------- */
.vz-state { padding: 34px 20px; text-align: center; font-size: 13px; color: #94a3b8; }
.vz-state--ok    { color: #22c55e; font-weight: 600; }
.vz-state--error { color: #ef4444; }
.vz-state small { display: block; margin-top: 4px; font-size: 11px; color: #64748b; }

/* --- Barra de progreso dentro de modales --------------------------------------- */
.vz-progress-track {
    background: #0f172a;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}
.vz-progress-bar {
    height: 100%;
    background: #f59e0b;
    width: 0%;
    transition: width 0.3s;
}

/* ============================================================================
   ANIMATION STUDIO — panel de recorridos de cámara y encuadre de salida.

   El panel NO es un modal: no bloquea la escena, porque el usuario tiene que
   seguir orbitando la nube mientras guarda cámaras. Reusa .vz-card para el
   aspecto, y agrega arrastre y el marco de encuadre sobre el visor.
   ============================================================================ */

.vzanim-panel {
    position: fixed;
    top: 76px;
    left: 76px;                    /* al lado de la barra de herramientas: la
                                      derecha ya la ocupan Powerlines y el
                                      panel de objetos */
    width: 340px;
    max-width: 340px;
    max-height: calc(100vh - 120px);
    z-index: 10050;                /* sobre los paneles laterales (10002),
                                      bajo los modales (100000) */
}
.vzanim-panel.vzanim-busy { opacity: 0.75; pointer-events: none; }
.vzanim-flash { animation: vzanim-flash 0.5s ease 2; }
@keyframes vzanim-flash { 50% { box-shadow: 0 0 0 2px #f59e0b; } }

.vzanim-head { display: flex; align-items: flex-start; cursor: move; }
.vzanim-head .vzanim-title { flex: 1; margin-bottom: 14px; }
.vzanim-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.vzanim-close:hover { color: #e5e7eb; }

.vzanim-slot { display: block; }

/* Lista de cámaras */
.vzanim-list {
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 8px;
}
.vzanim-vacio { padding: 18px 12px; text-align: center; font-size: 11px; color: #64748b; }
.vzanim-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.4);
    font-size: 12px;
}
.vzanim-item:last-child { border-bottom: none; }
.vzanim-num {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    font-size: 10px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex: none;
}
.vzanim-nom { flex: 1; color: #cbd5e1; }
.vzanim-mini {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #94a3b8;
    border-radius: 4px;
    width: 20px; height: 20px;
    font-size: 11px;
    cursor: pointer;
    flex: none;
}
.vzanim-mini:hover { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.vzanim-mini--del:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.vzanim-add { width: 100%; font-size: 12px; }
.vzanim-ease { margin-top: 4px; }
.vzanim-actions { margin-top: 16px; }

/* --- Encuadre sobre el visor ------------------------------------------------- */
.vzanim-overlay {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;          /* la escena sigue recibiendo el mouse */
    z-index: 500;
}
.vzanim-frame {
    position: absolute;
    border: 2px dashed #f59e0b;
    border-radius: 2px;
    /* Todo lo que queda fuera del encuadre, bajo un velo: lo que no se ve
       claro es lo que no entra en el video. */
    box-shadow: 0 0 0 4000px rgba(2, 6, 23, 0.6);
    pointer-events: none;
}
.vzanim-grab {
    position: absolute;
    left: 50%;
    top: -26px;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid #f59e0b;
    border-radius: 5px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    white-space: nowrap;
    cursor: move;
    pointer-events: auto;          /* el marco se mueve desde acá */
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}
.vzanim-h {
    position: absolute;
    width: 14px; height: 14px;
    background: #f59e0b;
    border-radius: 3px;
    pointer-events: auto;
}
.vzanim-h[data-corner="nw"] { left: -8px;  top: -8px;    cursor: nwse-resize; }
.vzanim-h[data-corner="ne"] { right: -8px; top: -8px;    cursor: nesw-resize; }
.vzanim-h[data-corner="sw"] { left: -8px;  bottom: -8px; cursor: nesw-resize; }
.vzanim-h[data-corner="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
