/* Consola de escritorio (molde de Otto). Ver components/craftos-escritorio.php.
   2026-10-28: mismo diseno que Otto (paleta institucional azul/amarillo, pantalla completa
   en computador con scroll propio por panel, filas plegables, iconos Word/PDF). Las reglas
   van bajo .craftos-desk para no tocar Otto ni otras apps. */
.mstep-container.craftos-desk {
    --desk-main: #05398B; --desk-main-dark: #032B6B; --desk-main-mid: #1D55AC;
    --desk-soft: #EDF3FB; --desk-line: #D4E0F2; --desk-accent: #F7DF04;
    --desk-ink: #14243F; --desk-muted: #5A6B85; --desk-bg: #F1F4F9;
    --desk-red: #C0392B; --desk-red-soft: #FBEAE8;
    max-width: none; margin: 0; padding: 0; background: var(--desk-bg);
    color: var(--desk-ink); font-size: 13px; border-radius: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.craftos-desk *, .craftos-desk *::before, .craftos-desk *::after { box-sizing: border-box; }
.craftos-desk .mstep-header, .craftos-desk .mstep-step-header, .craftos-desk .mstep-step-connector { display: none !important; }
.craftos-desk .mstep-step { border: none; background: transparent; margin: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.craftos-desk .mstep-step-body { padding: 0; }

/* ---------- Pantalla completa (solo computador) ---------- */
@media (min-width: 1024px) {
    html.craftos-desk-on, html.craftos-desk-on body { overflow: hidden !important; height: 100%; }
    .mstep-container.craftos-desk.craftos-desk-full { position: fixed; inset: 0; z-index: 99990; display: flex; flex-direction: column; }
    body.admin-bar .mstep-container.craftos-desk.craftos-desk-full { top: 32px; }
    .craftos-desk-full .desk-main { flex: 1; min-height: 0; align-items: stretch; padding: 12px 16px 14px; }
    .craftos-desk-full .desk-panel { display: flex; flex-direction: column; min-height: 0; }
    .craftos-desk-full .desk-panel-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #B9C9E2 transparent; }
    .craftos-desk .desk-panel-body::-webkit-scrollbar { width: 8px; }
    .craftos-desk .desk-panel-body::-webkit-scrollbar-thumb { background: #B9C9E2; border-radius: 4px; }
    .craftos-desk-full .desk-panel-nav { position: static; }
}
@media (max-width: 1023.98px) {
    .mstep-container.craftos-desk { max-width: 900px; margin: 0 auto; padding: 0 0 12px; }
}

/* ---------- Barra superior ---------- */
.desk-topbar { display: flex; align-items: center; gap: 16px; background: #fff; padding: 8px 22px; min-height: 68px; border-bottom: 3px solid var(--desk-main); position: relative; flex-shrink: 0; }
.desk-topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--desk-accent) 0 68%, var(--desk-main) 68% 84%, #DB1F1D 84%); }
.desk-logo { height: 36px; width: auto; display: block; flex-shrink: 0; }
.desk-divider { width: 1.5px; height: 40px; background: var(--desk-line); border-radius: 1px; flex-shrink: 0; }
.desk-titles { min-width: 0; }
.desk-titles h1 { margin: 0; font-size: 16.5px; font-weight: 800; color: var(--desk-main); line-height: 1.2; }
.desk-titles p { margin: 2px 0 0; font-size: 11.5px; color: var(--desk-muted); }
.desk-home { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--desk-main); text-decoration: none; padding: 8px 10px; border-radius: 7px; }
.desk-home:hover { background: var(--desk-soft); }

/* ---------- Paneles ---------- */
.desk-main { display: grid; grid-template-columns: 248px 1fr; gap: 14px; padding: 12px 16px 0; align-items: start; }
.desk-panel { background: #fff; border: 1px solid var(--desk-line); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(5, 57, 139, 0.07); }
.desk-panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; background: var(--desk-main); color: #fff; padding: 9px 14px; min-height: 46px; }
.desk-panel-head h2 { margin: 0; font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .2px; }
.desk-panel-num { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; background: var(--desk-accent); color: var(--desk-main-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.desk-panel-body { padding: 12px 14px 18px; }
.desk-panel-content .desk-panel-body > * { max-width: 880px; margin-left: auto; margin-right: auto; }
.desk-panel-nav { position: sticky; top: 12px; }

.desk-nav-body { display: flex; flex-direction: column; gap: 8px; }
.desk-navbtn { appearance: none; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--desk-line); border-radius: 10px; padding: 12px; font-family: inherit; color: var(--desk-ink); transition: background .15s, border-color .15s, box-shadow .15s; }
.desk-navbtn:hover { background: var(--desk-soft); border-color: var(--desk-main-mid); }
.desk-navbtn.active { background: var(--desk-main); border-color: var(--desk-main); box-shadow: 0 2px 8px rgba(5, 57, 139, 0.25); }
.desk-navbtn-num { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: var(--desk-soft); color: var(--desk-main); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.desk-navbtn.active .desk-navbtn-num { background: var(--desk-accent); color: var(--desk-main-dark); }
.desk-navbtn-text { min-width: 0; }
.desk-navbtn-label { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.desk-navbtn-sub { display: block; font-size: 10px; font-weight: 500; color: var(--desk-muted); margin-top: 1px; line-height: 1.3; }
.desk-navbtn.active .desk-navbtn-label { color: #fff; }
.desk-navbtn.active .desk-navbtn-sub { color: rgba(255, 255, 255, 0.8); }

.desk-tabs { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.desk-tab { appearance: none; cursor: pointer; background: rgba(255, 255, 255, 0.14); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 7px; padding: 6px 12px 7px; font-size: 12px; font-weight: 700; line-height: 1; }
.desk-tab:hover { background: rgba(255, 255, 255, 0.26); }
.desk-tab.active { background: #fff; color: var(--desk-main); border-color: #fff; box-shadow: inset 0 -3px 0 var(--desk-accent); }

/* ---------- Datos del caso ---------- */
.desk-datos { margin: 6px 0 14px; }
.desk-sectionlabel { font-size: 10.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--desk-main); margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--desk-soft); }
.desk-nota { font-size: 11.5px; color: var(--desk-muted); background: var(--desk-soft); border: 1px solid var(--desk-line); border-left: 3px solid var(--desk-main); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; line-height: 1.45; }
.desk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.desk-campo { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--desk-ink); }
.desk-campo input { width: 100%; padding: 8px 10px; border: 1.5px solid #C7D4E8; border-radius: 7px; font: inherit; font-weight: 400; font-size: 13px; background: #fff; }
.desk-campo input:focus { outline: none; border-color: var(--desk-main); box-shadow: 0 0 0 3px rgba(5, 57, 139, 0.12); }
.desk-plegado { margin: 14px 0 0; border: 1px solid var(--desk-line); border-radius: 8px; background: #FAFCFF; padding: 0; }
.desk-plegado summary { cursor: pointer; list-style: none; padding: 8px 12px; font-size: 11.5px; font-weight: 700; color: var(--desk-main); display: flex; align-items: center; gap: 7px; }
.desk-plegado summary::-webkit-details-marker { display: none; }
.desk-plegado summary::after { content: "\25BE"; margin-left: auto; transition: transform .15s; }
.desk-plegado[open] summary::after { transform: rotate(180deg); }
.desk-plegado[open] summary { border-bottom: 1px dashed var(--desk-line); margin-bottom: 0; }
.desk-plegado > *:not(summary) { margin: 10px 12px 12px; }

/* ---------- Campos y archivos (clases del sistema, escritas como Otto) ---------- */
.craftos-desk .mstep-field, .craftos-desk [class*="-field"].mstep-field { margin-bottom: 10px !important; }
.craftos-desk .mstep-label { display: block; font-size: 12px; font-weight: 700; color: var(--desk-ink); margin-bottom: 4px; }
.craftos-desk .mstep-required { color: var(--desk-red); margin-left: 3px; }
.craftos-desk .mstep-helper { display: block; font-size: 10.5px; color: #7C8AA5; margin-top: 3px; line-height: 1.35; }
.craftos-desk .mstep-text-input, .craftos-desk .mstep-field input[type="text"], .craftos-desk .mstep-field input[type="number"], .craftos-desk .mstep-field textarea, .craftos-desk .mstep-field select {
    width: 100%; padding: 8px 10px; border: 1.5px solid #C7D4E8; border-radius: 7px; background: #fff; font-family: inherit; font-size: 13px; color: var(--desk-ink);
}
.craftos-desk .mstep-field input:focus, .craftos-desk .mstep-field textarea:focus, .craftos-desk .mstep-field select:focus { outline: none; border-color: var(--desk-main); box-shadow: 0 0 0 3px rgba(5, 57, 139, 0.12); }
.craftos-desk .mstep-field .file-area { border: 1.5px dashed #A9BFDF; border-radius: 8px; padding: 9px 10px; background: var(--desk-soft); min-height: 46px; }

.craftos-desk .lumina-mfc { background: var(--desk-soft); border: 1px solid var(--desk-line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.craftos-desk .lumina-mfc-title { font-size: 11px; font-weight: 800; color: var(--desk-main); margin: 0 0 8px; display: block; text-transform: uppercase; letter-spacing: .6px; }
.craftos-desk .lumina-mfc-dropzone { border: 2px dashed #93AFD9; border-radius: 8px; padding: 13px 12px; text-align: center; cursor: pointer; background: #fff; }
.craftos-desk .lumina-mfc-dropzone:hover { background: #F4F8FE; border-color: var(--desk-main); }
.craftos-desk .lumina-mfc-dropzone-text { font-size: 12.5px; color: var(--desk-ink); font-weight: 700; margin: 0; }
.craftos-desk .lumina-mfc-dropzone-hint { font-size: 10.5px; color: #7C8AA5; margin: 3px 0 0; }
.craftos-desk .lumina-mfc-list { margin-top: 8px; }
.craftos-desk .lumina-mfc-list-title { font-size: 10px; color: var(--desk-muted); text-transform: uppercase; letter-spacing: .6px; margin: 0 0 6px; font-weight: 800; }
.craftos-desk .lumina-mfc-empty { font-size: 11px; color: #8B99B1; margin: 2px 0 0; font-style: italic; }
.craftos-desk .lumina-mfc-file { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #fff; border: 1.5px solid #DCE5F2; border-radius: 8px; margin-bottom: 6px; }
.craftos-desk .lumina-mfc-file.is-uploading { border-color: #E5C544; background: #FFFDF2; }
.craftos-desk .lumina-mfc-file.is-ready { border-color: #2E9E5B; background: #F2FBF5; }
.craftos-desk .lumina-mfc-file-icon { width: 28px; height: 28px; flex-shrink: 0; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: #EAEFF7; color: #8B99B1; }
.craftos-desk .lumina-mfc-file.is-ready .lumina-mfc-file-icon { background: var(--desk-main); color: var(--desk-accent); }
.craftos-desk .lumina-mfc-file.is-ready .lumina-mfc-file-icon.desk-fico { background: #fff; border: 1.5px solid var(--desk-line); }
.craftos-desk .lumina-mfc-file-name { font-size: 12px; font-weight: 600; color: var(--desk-ink); margin: 0; word-break: break-word; }
.craftos-desk .lumina-mfc-file-remove { background: transparent; border: none; color: var(--desk-red); cursor: pointer; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.craftos-desk .lumina-mfc-file-remove:hover { background: var(--desk-red-soft); }
/* Archivo cargado en un campo suelto: icono Word/PDF en vez del chulo */
.desk-fstat { display: inline-flex; align-items: center; gap: 8px; color: var(--desk-ink) !important; font-weight: 600; }
.desk-fstat svg { flex-shrink: 0; display: block; }

/* ---------- Filas plegables (instruccion para la IA) ---------- */
.craftos-desk .mstep-prompt-section[data-plegado] { margin: 10px 0; padding: 0; border: 1px solid var(--desk-line); border-radius: 8px; background: #FAFCFF; }
.craftos-desk .mstep-prompt-section[data-plegado] > .mstep-prompt-label { display: flex !important; align-items: center; gap: 7px; margin: 0; padding: 8px 12px; font-size: 11.5px; font-weight: 700; color: var(--desk-main); cursor: pointer; user-select: none; }
.craftos-desk .mstep-prompt-section[data-plegado]:not(.desk-instr-cerrada) > .mstep-prompt-label { border-bottom: 1px dashed var(--desk-line); }
.craftos-desk .mstep-prompt-section[data-plegado] .desk-instr-flecha { margin-left: auto; }
.craftos-desk .mstep-prompt-section[data-plegado] > :not(.mstep-prompt-label) { margin: 10px 12px 12px; }
.craftos-desk .mstep-prompt-textarea { width: 100%; min-height: 110px; padding: 10px; border: 1.5px solid #C7D4E8; border-radius: 7px; font-family: inherit; font-size: 12px; line-height: 1.55; color: var(--desk-ink); resize: vertical; background: #fff; }
.craftos-desk .mstep-prompt-textarea:focus { outline: none; border-color: var(--desk-main); box-shadow: 0 0 0 3px rgba(5, 57, 139, 0.12); }

/* ---------- Botones, resultados y documentos ---------- */
.craftos-desk .mstep-btn { width: 100%; border: none; cursor: pointer; margin-top: 10px; background: linear-gradient(180deg, var(--desk-main-mid) 0%, var(--desk-main) 55%, var(--desk-main-dark) 100%); color: #fff; padding: 11px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; letter-spacing: .2px; box-shadow: 0 3px 10px rgba(5, 57, 139, 0.28); transition: transform .12s, box-shadow .15s, filter .15s; }
.craftos-desk .mstep-btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 6px 16px rgba(5, 57, 139, 0.35); }
.craftos-desk .mstep-btn:disabled { background: #AEBBD1; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.craftos-desk .mstep-output-section { margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--desk-soft); }
.craftos-desk .mstep-output-header-mini { text-align: left; padding: 0 0 8px; background: transparent; border: none; margin-bottom: 4px; }
.craftos-desk .mstep-output-header-mini h3 { font-size: 11px; font-weight: 800; margin: 0; color: var(--desk-main); text-transform: uppercase; letter-spacing: .8px; }
.craftos-desk .mstep-pdf-card { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--desk-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; text-decoration: none; color: inherit; }
.craftos-desk .mstep-pdf-card:hover { border-color: var(--desk-main); box-shadow: 0 4px 12px rgba(5, 57, 139, 0.14); }
.craftos-desk .mstep-pdf-icon { width: 38px; height: 38px; background: var(--desk-main); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-right: 12px; }
.craftos-desk .mstep-pdf-icon--word { background: #fff; border: 1.5px solid var(--desk-line); }
.craftos-desk .mstep-pdf-icon span { color: var(--desk-accent); font-size: 10px; font-weight: 800; }
.craftos-desk .mstep-pdf-name { font-size: 12.5px; font-weight: 700; color: var(--desk-ink); margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.craftos-desk .mstep-pdf-meta { font-size: 10.5px; color: #7C8AA5; margin: 0; }
.craftos-desk .mstep-pdf-dl { width: 30px; height: 30px; background: var(--desk-soft); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: 8px; color: var(--desk-main); }

/* ---------- Responsive ---------- */
@media (max-width: 1023.98px) {
    .desk-main { grid-template-columns: 1fr; padding: 10px; }
    .desk-panel-nav { position: static; }
    .desk-nav-body { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .desk-navbtn { flex: 0 0 auto; max-width: 260px; }
    .desk-navbtn-sub { display: none; }
    .desk-tabs { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .desk-tab { flex: 0 0 auto; white-space: nowrap; }
    .craftos-desk .desk-panel-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 640px) {
    .desk-topbar { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; min-height: 0; }
    .desk-logo { height: 28px; }
    .desk-divider { display: none; }
    .desk-titles { flex: 1 1 100%; order: 9; }
    .desk-titles h1 { font-size: 13.5px; }
    .desk-titles p { display: none; }
    .desk-grid2 { grid-template-columns: 1fr; }
    .desk-panel-body { padding: 10px; }
    .craftos-desk img, .craftos-desk video { max-width: 100%; height: auto; }
}

/* La app ocupa la pantalla: sin cabecera ni pie del sitio (como Otto). */
html.craftos-desk-on body .site-header, html.craftos-desk-on body .site-footer, html.craftos-desk-on body footer.footer, html.craftos-desk-on body header.site-header { display: none !important; }

/* Constructor del criterio: fila plegable como "Criterio / guia" de Otto. */
.craftos-desk .ccx-box { margin: 6px 0 0; }
.craftos-desk .ccx-box > details { border: 1px solid var(--desk-line); border-radius: 8px; background: #FAFCFF; margin: 8px 0 0; }
.craftos-desk .ccx-box > details > summary { list-style: none; display: flex; align-items: center; gap: 7px; padding: 8px 12px; font-size: 11.5px !important; font-weight: 700 !important; color: var(--desk-main) !important; }
.craftos-desk .ccx-box > details > summary::-webkit-details-marker { display: none; }
.craftos-desk .ccx-box > details > summary::after { content: "\25BE"; margin-left: auto; transition: transform .15s; }
.craftos-desk .ccx-box > details[open] > summary { border-bottom: 1px dashed var(--desk-line); }
.craftos-desk .ccx-box > details[open] > summary::after { transform: rotate(180deg); }
.craftos-desk .ccx-box > details > *:not(summary) { margin-left: 12px; margin-right: 12px; }
.craftos-desk .ccx-box .ccx-nota { font-size: 11.5px; color: var(--desk-muted); line-height: 1.5; }
.craftos-desk .ccx-caso { background: var(--desk-soft); border: 1px solid var(--desk-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.craftos-desk .ccx-caso-t { font-size: 11px; font-weight: 800; color: var(--desk-main); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.craftos-desk .ccx-drop { border: 2px dashed #93AFD9 !important; border-radius: 8px !important; background: #fff !important; color: var(--desk-ink); font-size: 12px; }
.craftos-desk .ccx-drop:hover { border-color: var(--desk-main) !important; background: #F4F8FE !important; }
.craftos-desk .ccx-add, .craftos-desk .ccx-go { appearance: none; cursor: pointer; border-radius: 8px; padding: 8px 14px; font: 700 12px/1.2 inherit; margin: 4px 6px 12px 0; }
.craftos-desk .ccx-add { background: #fff; color: var(--desk-main); border: 1.5px dashed #9FBBE6; }
.craftos-desk .ccx-add:hover { background: var(--desk-soft); border-style: solid; }
.craftos-desk .ccx-go { background: var(--desk-main); color: #fff; border: 1.5px solid var(--desk-main); }
.craftos-desk .ccx-go:hover { filter: brightness(1.08); }
.craftos-desk .ccx-go:disabled { background: #AEBBD1; border-color: #AEBBD1; cursor: not-allowed; }
.desk-navbtn-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Barra de casos (Otto) ---------- */
.desk-casebar { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex-shrink: 0; padding: 9px 22px; background: linear-gradient(90deg, var(--desk-main-dark) 0%, var(--desk-main) 100%); color: #fff; border-bottom: 1px solid var(--desk-main-mid); }
.desk-casebar.is-empty { background: linear-gradient(90deg, #4A5568 0%, #64748B 100%); border-bottom-color: #94A3B8; }
.desk-casebar-tag { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; font-size: 9.5px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--desk-accent); padding-right: 12px; border-right: 1px solid rgba(255,255,255,.25); }
.desk-casebar.is-empty .desk-casebar-tag { color: #E2E8F0; }
.desk-casebar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--desk-accent); box-shadow: 0 0 0 3px rgba(247,223,4,.2); }
.desk-casebar.is-empty .desk-casebar-dot { background: #CBD5E1; box-shadow: 0 0 0 3px rgba(203,213,225,.2); }
.desk-casebar-body { flex: 1; min-width: 0; }
.desk-casebar-name { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-casebar-meta { margin: 1px 0 0; font-size: 11px; color: rgba(255,255,255,.78); }
.desk-casebar-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.desk-casebar-btn { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border-radius: 8px; padding: 8px 13px; font: 800 12px/1 inherit; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.45); }
.desk-casebar-btn:hover { background: rgba(255,255,255,.25); border-color: #fff; }
.desk-casebar-btn.primary { background: var(--desk-accent); border-color: var(--desk-accent); color: var(--desk-main); }
.desk-casebar-btn.primary:hover { filter: brightness(1.07); }
.desk-casebar-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(5,57,139,.16); font-size: 10.5px; }
.desk-casebar-caret { font-size: 9px; transition: transform .18s; }
.desk-casebar-btn.open .desk-casebar-caret { transform: rotate(180deg); }
.desk-casebar-spin { display: inline-block; width: 11px; height: 11px; border: 2px solid rgba(5,57,139,.25); border-top-color: var(--desk-main); border-radius: 50%; animation: desk-spin .8s linear infinite; }
@keyframes desk-spin { to { transform: rotate(360deg); } }
.desk-casepicker { position: absolute; right: 18px; top: calc(100% + 6px); z-index: 50; width: min(460px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: #fff; color: var(--desk-ink); border: 1px solid var(--desk-line); border-radius: 12px; box-shadow: 0 18px 40px rgba(5,57,139,.25); padding: 10px; }
.desk-casepicker[hidden] { display: none; }
.desk-casepicker-q { width: 100%; padding: 8px 10px; border: 1.5px solid #C7D4E8; border-radius: 8px; font: inherit; font-size: 12.5px; margin-bottom: 8px; }
.desk-casepicker-item { appearance: none; cursor: pointer; display: block; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--desk-line); border-radius: 9px; padding: 9px 11px; margin-bottom: 6px; font-family: inherit; }
.desk-casepicker-item:hover { background: var(--desk-soft); border-color: var(--desk-main-mid); }
.desk-casepicker-nom { display: block; font-size: 12.5px; font-weight: 700; color: var(--desk-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-casepicker-meta { display: block; font-size: 10.5px; color: var(--desk-muted); margin-top: 2px; }
.desk-casepicker-empty { font-size: 12px; color: var(--desk-muted); margin: 6px 2px; }
.craftos-desk .checklist-case-bar { display: none !important; }
@media (max-width: 640px) {
    .desk-casebar { padding: 8px 12px; gap: 8px; }
    .desk-casebar-tag { border-right: none; padding-right: 0; }
    .desk-casebar-body { flex: 1 1 100%; order: 3; }
    .desk-casebar-actions { margin-left: auto; }
    .desk-casepicker { right: 8px; }
}

/* ---------- Cola de analisis en segundo plano (Otto) ---------- */
.checklist-cola { display: none; margin: 10px 0 4px; border: 1px solid #D6E2F5; border-radius: 10px; background: #F7FAFF; padding: 10px 12px; }
.checklist-cola.show { display: block; }
.checklist-cola-head { margin-bottom: 8px; }
.checklist-cola-head b { display: block; font-size: 12.5px; font-weight: 800; color: var(--desk-main, #05398B); }
.checklist-cola-head span { display: block; font-size: 11px; color: #5B6B87; margin-top: 2px; }
.checklist-cola-lista { display: flex; flex-direction: column; gap: 6px; }
.checklist-cola-item { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #E3EAF6; border-radius: 8px; padding: 7px 10px; font-size: 12px; }
.checklist-cola-item.ok { border-color: #BFE3C9; background: #F4FCF6; }
.checklist-cola-item.err { border-color: #F2C7C7; background: #FDF6F6; }
.checklist-cola-spin { flex: 0 0 auto; width: 13px; height: 13px; border: 2px solid rgba(5,57,139,.22); border-top-color: #05398B; border-radius: 50%; animation: desk-spin .8s linear infinite; }
.checklist-cola-mark { flex: 0 0 auto; font-weight: 800; color: #1E8E4A; }
.checklist-cola-item.err .checklist-cola-mark { color: #B4232A; }
.checklist-cola-nom { flex: 1 1 auto; font-weight: 700; color: #14243F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist-cola-t, .checklist-cola-msg { flex: 0 0 auto; color: #5B6B87; font-variant-numeric: tabular-nums; }
.checklist-cola-abrir, .checklist-cola-x { flex: 0 0 auto; border: 1px solid #C9D8F0; background: #fff; color: #05398B; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.checklist-cola-x { color: #8B99B1; border-color: #E3EAF6; padding: 3px 7px; }
.checklist-cola-otro { margin-top: 9px; width: 100%; border: 1px dashed #9FBBE6; background: #fff; color: #05398B; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 8px; cursor: pointer; }
.checklist-cola-otro:hover { background: #EEF4FE; border-style: solid; }
.craftos-desk img.desk-logo { height: 36px; width: auto; max-width: none; }
@media (max-width: 640px) { .craftos-desk img.desk-logo { height: 26px; } .desk-home { margin-left: auto; } }

/* Ayuda por etapa (boton ?) */
.desk-ayuda{max-width:880px;margin:0 auto 14px;padding:10px 14px;background:#FFF9D6;border:1px solid #F7DF04;border-radius:10px;font-size:13px;color:#1f2937}
.desk-ayuda-btn{width:22px;height:22px;border-radius:50%;border:none;background:#05398B;color:#fff;font-weight:700;cursor:pointer;margin-right:8px;line-height:22px;padding:0}
.desk-ayuda-lbl{font-weight:600;cursor:pointer;color:#05398B}
.desk-ayuda-txt{margin-top:8px;line-height:1.5;white-space:pre-line}
