/* ==========================================================================
   NMSolutions Scripts - estilos propios
   Se cargan despues de site.css y soporte.css (mismas variables y componentes que CRM / Soporte).
   ========================================================================== */

/* Listado + panel con el SQL (como la pantalla anterior de WebTickets) */
.nms-scripts-layout { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 10fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .nms-scripts-layout { grid-template-columns: minmax(0, 1fr); } }

.nms-script-nombre { font-weight: 500; word-break: break-word; }
.nms-version-txt { font-variant-numeric: tabular-nums; }
.nms-row-sel > td { background: var(--nms-info-soft) !important; }
.nms-row-sel > td:first-child { box-shadow: inset 3px 0 0 var(--nms-brand); }

.nms-script-panel { position: sticky; top: 76px; padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
@media (max-width: 1100px) { .nms-script-panel { position: static; max-height: none; } }
.nms-script-head { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-bottom: 1px solid var(--nms-line); }
.nms-script-titulo { font-weight: 600; font-size: 1rem; word-break: break-word; margin-bottom: 2px; }
.nms-link-sql { color: var(--nms-brand); text-decoration: none; font-weight: 500; }
.nms-link-sql:hover { text-decoration: underline; }

.nms-sql, .nms-sql-editor {
    font-family: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
    font-size: .84rem; line-height: 1.5; tab-size: 4;
}
.nms-sql {
    margin: 0; padding: .9rem 1rem; overflow: auto; flex: 1; min-height: 240px;
    white-space: pre; background: #fbfcfe; color: #1f2937;
}
.nms-sql-editor {
    width: 100%; box-sizing: border-box; min-height: 52vh; resize: vertical; padding: .75rem .85rem;
    border: 1px solid #c9d2de; border-radius: 6px; background: #fbfcfe; color: #1f2937; white-space: pre; overflow: auto;
}
.nms-sql-editor:focus { outline: none; border-color: var(--nms-brand); box-shadow: 0 0 0 3px rgba(10, 102, 194, .15); }

/* Barra "Crear version" */
.nms-version-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem;
    padding: .8rem 1rem; border-radius: 10px; border: 1px solid #cfe3d4; background: #f3faf5;
}
.nms-version-bar-info { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.nms-version-bar-info > .rzi, .nms-version-bar-info > .rz-icon { font-size: 1.6rem; color: var(--nms-ok); }
.nms-version-bar-accion { display: flex; gap: .4rem; align-items: center; }
.nms-link-btn { border: 0; background: transparent; cursor: pointer; color: var(--nms-muted); padding: .3rem; border-radius: 6px; display: inline-flex; }
.nms-link-btn:hover:not(:disabled) { color: var(--nms-brand); background: rgba(10, 102, 194, .08); }
