/* ============================================================================
   OMNIA Sketch · CARCASA
   ----------------------------------------------------------------------------
   Sólo lo que rodea al motor. El CSS del motor vive dentro de su propio
   fragmento, con todo bajo `#omnia-cad-functional`, y no se toca desde aquí.
   Todo lo de esta hoja lleva prefijo `sk-` para que no se crucen jamás.
   Se reusan sus variables (`--cf-*`) para que la carcasa no desentone.
   ========================================================================== */

html, body { margin: 0; height: 100%; background: #0c0f14; }
body {
    font-family: Inter, 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #e9edf4;
}

/* ── Pantalla de acceso ─────────────────────────────────────────────────── */
#sk-acceso {
    position: fixed; inset: 0; z-index: 200000;
    display: flex; align-items: center; justify-content: center;
    padding: 32px;
    background: #0c0f14;
}
#sk-acceso[hidden] { display: none; }
.sk-acceso-caja { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; text-align: center; }

/* Logotipo aprobado por el propietario: arco abierto, estructura tipo A y eje
   vertical azul. La referencia está en OMNIA CADX/assets/. */
.sk-marca { width: 76px; height: 76px; margin-bottom: 16px; }
.sk-marca::before {
    content: '';
    display: block; width: 100%; height: 100%;
    background: center / contain no-repeat url("icono.svg");
}
.sk-lema {
    margin-bottom: 34px;
    font-size: 12px; font-weight: 500;
    letter-spacing: .38em; text-indent: .19em;
    color: #8c97a8; text-transform: uppercase;
}
.sk-btn-acceso {
    width: 100%; min-height: 46px; padding: 0 20px;
    border: 1px solid #2a313c; border-radius: 10px;
    background: #151920; color: #e9edf4;
    font: inherit; font-size: 13.5px; font-weight: 550;
    cursor: pointer; transition: border-color .18s ease, background-color .18s ease;
}
.sk-btn-acceso:hover { border-color: #3a4250; background: #1b2029; }
.sk-acceso-nota { margin-top: 18px; font-size: 11px; line-height: 1.5; color: #6f7b8c; }
.sk-acceso-nota.es-error { color: #ff8a8a; }

/* ── Barra: vínculo con el deal ─────────────────────────────────────────── */
/* Se inserta en la barra del motor, entre la marca y sus acciones. Ocupa el
   espacio sobrante sin empujar las herramientas CAD, que son lo importante. */
.sk-barra {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px;
}

.sk-deal { position: relative; flex: 0 1 380px; min-width: 150px; }
.sk-deal-campo {
    display: flex; align-items: center; gap: 7px;
    min-height: 32px; padding: 0 9px;
    border: 1px solid #2a313c; border-radius: 7px;
    background: #1b2029;
    transition: border-color .16s ease;
}
.sk-deal-campo:focus-within { border-color: #4a9eff; }
.sk-deal.es-vinculado .sk-deal-campo { border-color: #2f6b4a; }
.sk-deal-ico {
    width: 12px; height: 12px; flex: none; opacity: .6;
    background: currentColor;
    -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M10 2a8 8 0 105.3 14L21 21.7 22.4 20l-5.7-5.7A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E");
            mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M10 2a8 8 0 105.3 14L21 21.7 22.4 20l-5.7-5.7A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E");
}
.sk-deal input {
    flex: 1; min-width: 0;
    border: 0; background: transparent; color: #e9edf4;
    font: inherit; font-size: 12.5px; outline: none;
}
.sk-deal input::placeholder { color: #6f7b8c; }
.sk-deal input::-webkit-search-cancel-button { display: none; }

.sk-deal-chip {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 190px; padding: 2px 4px 2px 8px;
    border-radius: 999px; background: #1d3a2b;
    font-size: 11px; font-weight: 600; color: #8ee0b0;
}
.sk-deal-chip[hidden] { display: none; }
.sk-deal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-chip-p { width: 5px; height: 5px; border-radius: 50%; background: #4ade80; flex: none; }
.sk-chip-x {
    width: 17px; height: 17px; flex: none;
    border: 0; border-radius: 50%; background: transparent;
    color: inherit; font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.sk-chip-x:hover { background: rgba(255,255,255,.12); }

.sk-deal-lista {
    position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 60;
    max-height: 320px; overflow-y: auto;
    border: 1px solid #2a313c; border-radius: 9px;
    background: #151920;
    box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.sk-deal-lista[hidden] { display: none; }
.sk-deal-op {
    width: 100%; padding: 9px 12px;
    display: grid; grid-template-columns: auto 1fr; gap: 2px 9px;
    border: 0; border-bottom: 1px solid #21272f;
    background: transparent; color: #e9edf4;
    font: inherit; text-align: left; cursor: pointer;
}
.sk-deal-op:last-child { border-bottom: 0; }
.sk-deal-op:hover { background: #1b2029; }
.sk-deal-op b { font-size: 11.5px; color: #4a9eff; font-family: 'IBM Plex Mono', monospace; }
.sk-deal-op span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-deal-op small { grid-column: 1 / -1; font-size: 10.5px; color: #6f7b8c; }

.sk-deal-msg { padding: 13px 14px; font-size: 12px; color: #929cad; line-height: 1.5; }
.sk-deal-msg small { display: block; margin-top: 4px; font-size: 10.5px; color: #6f7b8c; }
.sk-deal-lista.es-error .sk-deal-msg { color: #ff9b9b; }
.sk-deal-lista.es-aviso .sk-deal-msg { color: #e5b567; }

.sk-spin {
    display: inline-block; width: 10px; height: 10px; margin-right: 5px;
    border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: sk-gira .7s linear infinite;
}
@keyframes sk-gira { to { transform: rotate(360deg); } }

/* ── Acciones de la carcasa ─────────────────────────────────────────────── */
.sk-guardar, .sk-biblio {
    min-height: 32px; padding: 0 13px; flex: none;
    border: 1px solid #2a313c; border-radius: 7px;
    background: #1b2029; color: #e9edf4;
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}
.sk-guardar:hover { border-color: #4a9eff; background: #1f2732; }
.sk-guardar:disabled, .sk-biblio:disabled { opacity: .45; cursor: not-allowed; }
.sk-biblio { color: #929cad; }

.sk-usuario { display: flex; align-items: center; gap: 8px; flex: none; font-size: 11.5px; color: #929cad; }
.sk-usuario button {
    border: 0; background: transparent; color: #6f7b8c;
    font: inherit; font-size: 11px; cursor: pointer; text-decoration: underline;
}
.sk-usuario button:hover { color: #e9edf4; }

/* ── Avisos ─────────────────────────────────────────────────────────────── */
.sk-aviso {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
    z-index: 100000;
    padding: 10px 18px;
    border: 1px solid #2a313c; border-radius: 999px;
    background: #151920; color: #e9edf4;
    font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.sk-aviso[hidden] { display: none; }
.sk-aviso.es-error { border-color: #6b2f2f; color: #ff9b9b; }
.sk-aviso.es-aviso { border-color: #6b5a2f; color: #e5b567; }

/* En pantallas estrechas el combobox se encoge antes que las herramientas. */
@media (max-width: 1100px) {
    .sk-deal { flex-basis: 220px; }
    .sk-usuario span { display: none; }
}
@media (max-width: 820px) {
    .sk-biblio { display: none; }
    .sk-guardar { padding: 0 9px; font-size: 0; }
    .sk-guardar::after { content: '↑'; font-size: 14px; }
}
