/* Medidas compactas y acotadas: no heredar tamaños rem del tema general. */
.com-pagina{color:#334155;font-family:inherit}
.com-contenido{margin:16px 2%;font-size:13px;line-height:1.4}
.com-toolbar,.com-paginacion,.com-metadatos{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.com-toolbar{justify-content:space-between}
#com-vista{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
#com-vista label{display:inline-flex;align-items:center;gap:5px;margin:0;padding:5px 9px;border:1px solid #CCD7E5;border-radius:6px;font-size:12px;line-height:18px;font-weight:600;color:#52647C;cursor:pointer}
#com-vista label:has(input:checked){color:#003875;background:#EDF3FC;border-color:#A9BED9}
#com-vista input{width:13px;height:13px;margin:0;accent-color:#00489A}
.com-ayuda,.com-modal small{color:#718096;font-size:12px;line-height:1.4;margin:6px 0 10px}
.com-filtros{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px;background:#F6F8FB;padding:10px;border:1px solid #E3D7B5;border-radius:8px;margin:12px 0}
.com-filtros>div{flex:0 1 180px;min-width:150px}
.com-filtros>div:first-child{flex:0 1 280px;min-width:200px}
.com-filtros>.btn{flex:0 0 auto}
.com-pagina label,.com-modal label{display:block;font-size:12px!important;font-weight:600;color:#003875;margin:6px 0 4px;line-height:1.3}
.com-contenido .form-control,.com-modal .form-control{box-sizing:border-box;font-size:12px!important;line-height:18px!important;min-height:30px!important;height:30px;padding:5px 8px!important;border:1px solid #C9A227!important;border-radius:6px}
.com-contenido .btn,.com-modal .btn{box-sizing:border-box;min-height:28px!important;height:auto;font-family:inherit;font-size:12px!important;line-height:18px!important;font-weight:600;border-radius:6px;padding:4px 8px!important;box-shadow:none;white-space:nowrap}
.com-contenido .btn-primary,.com-modal .btn-primary{background:#00489A;border-color:#00489A}
.com-contenido .btn-outline-primary,.com-modal .btn-outline-primary{background:#F0F5FC;color:#00489A;border-color:#A9BED9}
/* El texto visible, el buscador y las opciones del selector comparten escala. */
:is(.com-contenido,.com-modal) :is(.Select,.Select-menu-outer,.Select-option,.VirtualizedSelectOption,.Select-value-label){font-size:12px!important}
:is(.com-contenido,.com-modal) .Select-control{box-sizing:border-box;height:30px!important;min-height:30px!important;border:1px solid #C9A227!important;border-radius:6px}
:is(.com-contenido,.com-modal) :is(.Select-placeholder,.Select--single>.Select-control .Select-value){line-height:28px!important;padding-left:8px;padding-right:30px;font-size:12px!important}
:is(.com-contenido,.com-modal) .Select-input{height:28px!important;line-height:28px!important;padding-left:8px}
:is(.com-contenido,.com-modal) .Select-input>input{font-size:12px!important;line-height:18px!important;padding:5px 0!important}
:is(.com-contenido,.com-modal) .Select-option{padding:6px 8px}
.com-tabla{width:fit-content;max-width:100%;overflow:auto;border:1px solid #C9A227;border-radius:8px}
.com-tabla table{margin:0;width:auto!important;table-layout:auto;font-size:12px!important;line-height:1.35}
.com-tabla thead th{background:#003875;color:white;border-bottom:2px solid #C9A227;padding:7px 8px!important;font-size:12px!important;font-weight:600}
.com-tabla td{vertical-align:middle;padding:6px 8px!important;border-color:#E3D7B5;font-size:12px!important}
/* Tabla de anchura natural: ninguna columna se estira para rellenar la página. */
.com-tabla :is(th,td):not(:first-child){width:auto;white-space:nowrap}
.com-tabla td+td{border-left:1px solid #E3D7B5}
.com-tabla th+th{border-left:1px solid rgba(201,162,39,.45)}
.com-tabla td:first-child>strong{display:block;max-width:300px;white-space:normal;overflow-wrap:anywhere}
.com-tabla td:first-child{overflow-wrap:anywhere;min-width:180px}
.com-tabla td small{display:block;color:#718096;margin-top:2px;font-size:11px}
.com-tabla td .badge{margin-right:6px;font-size:10px;line-height:1.3}
.com-tabla td .btn{min-height:26px!important;padding:3px 8px!important}
.com-badge{font-size:11px;font-weight:600}
.com-paginacion{justify-content:flex-end;margin:10px 0;font-size:12px}
.com-vacio{padding:14px 10px;color:#718096;font-size:12px;margin:0}
/* dbc aplica className e id al propio modal-dialog, no a su padre. */
:is(#com-modal-nueva,#com-modal-detalle).modal-dialog,.com-modal .modal-dialog{width:calc(100% - 32px)!important;max-width:580px!important;margin-inline:auto}
.com-modal .modal-content{border:1px solid #C9A227;border-radius:10px;overflow:hidden;font-size:13px;line-height:1.4}
.com-modal .modal-header{background:#003875;border-bottom:2px solid #C9A227;padding:10px 14px}
.com-modal .modal-title{color:white;font-size:14px!important;font-weight:700;line-height:1.3}
.com-modal .btn-close{filter:invert(1);opacity:.9;font-size:14px;padding:6px}
.com-modal .modal-body{padding:12px 14px}
.com-modal .modal-footer{padding:8px 14px;gap:6px}
.com-modal .modal-footer>.btn{margin:0}
.com-modal textarea.form-control{min-height:58px!important;height:58px;resize:vertical}
.com-dos{display:grid;grid-template-columns:minmax(0,190px) minmax(0,180px);gap:10px}
.com-gestion{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end;margin:12px 0}
.com-gestion>div{flex:0 1 175px;min-width:140px}
.com-modal h3{font-size:13px!important;font-weight:700;color:#003875;margin:12px 0 6px}
.com-texto{white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0;font-size:13px}
.com-mensaje{border:1px solid #DCE5F0;background:#F7F9FC;border-radius:6px;padding:8px 10px;margin:6px 0}
.com-metadatos{justify-content:space-between;font-size:12px}
.com-adjunto{display:inline-block;background:#EDF3FC;color:#00489A;border:1px solid #B7C7DC;border-radius:6px;padding:5px 8px;margin:5px 0;font-size:12px}
.com-contenido .alert,.com-modal .alert{font-size:12px;padding:8px 10px;margin:8px 0}
@media(max-width:900px){.com-contenido{margin-inline:10px}.com-tabla td:first-child{min-width:160px}}
@media(max-width:550px){.com-filtros>div,.com-filtros>div:first-child{flex:1 1 100%;min-width:0}.com-dos{grid-template-columns:1fr}.com-toolbar{align-items:flex-start}.com-paginacion{justify-content:center}}
@media(pointer:coarse){.com-contenido .btn,.com-modal .btn,#com-vista label{min-height:40px!important}}

/* Formulario breve: dos columnas para el contexto y una fila de adjunto. */
.com-incidencia-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.com-incidencia-grid>div{min-width:0}
.com-adjunto-form{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px;margin-top:10px;padding-top:8px;border-top:1px solid #E1E8F0}
.com-adjunto-form>div:first-child{flex:0 0 auto;margin-right:auto}
.com-adjunto-form label{margin:0 0 2px}
.com-adjunto-form small{display:block;margin:0;font-size:10px}
#com-captura-nombre{flex:1 1 100px;min-width:0;max-width:160px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;font-size:11px}
#com-captura{flex:0 0 auto}
#com-quitar-captura:disabled{display:none}
#com-error-crear:empty{display:none}
@media(max-width:550px){.com-incidencia-grid{grid-template-columns:1fr}.com-adjunto-form>div:first-child{flex:1 1 100%}}

/* Un único scroll en el cuerpo: cabecera y acciones permanecen visibles. */
.modal:has(.com-modal){overflow:hidden!important}
.com-modal.modal-dialog{overflow:visible!important;max-height:calc(100dvh - 32px)}
.com-modal .modal-content{display:flex;flex-direction:column;max-height:calc(100dvh - 32px);overflow:hidden!important}
.com-modal :is(.modal-header,.modal-footer){flex-shrink:0;overflow:visible!important}
.com-modal .modal-body{min-height:0;overflow-y:auto!important;overflow-x:hidden!important;padding:12px 14px!important;scrollbar-gutter:stable}
:is(.com-modal .modal-body,.com-tabla){scrollbar-width:thin;scrollbar-color:#A78018 #F1F4F8}
:is(.com-modal .modal-body,.com-tabla)::-webkit-scrollbar{width:9px;height:9px}
:is(.com-modal .modal-body,.com-tabla)::-webkit-scrollbar-track{background:#F1F4F8;border-radius:6px}
:is(.com-modal .modal-body,.com-tabla)::-webkit-scrollbar-thumb{background:#A78018;border:2px solid #F1F4F8;border-radius:6px}
:is(.com-modal .modal-body,.com-tabla)::-webkit-scrollbar-thumb:hover{background:#806010}
.com-form-top{display:grid;grid-template-columns:170px 140px minmax(0,1fr);gap:8px}
.com-form-top>div{min-width:0}
.com-form-text{display:flex;flex-wrap:wrap;gap:10px}
.com-form-text>div{flex:0 1 260px;min-width:0}
.com-form-text textarea.form-control{height:72px;min-height:72px!important}
@media(max-width:550px){.com-form-top{grid-template-columns:1fr 1fr}.com-form-top>div:last-child{grid-column:1/-1}.com-form-text>div{flex:1 1 100%}}

.com-captura-seleccion{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%}
.com-adjunto-form>.com-adjunto-control{margin-right:0}
.com-adjunto-control small{margin-top:3px}
.com-captura-seleccion:has(#com-captura-nombre:empty){display:none}
.com-captura-seleccion #com-captura-nombre{flex:0 1 auto;max-width:150px}
#com-quitar-captura[hidden],#com-quitar-captura:disabled{display:none!important}

/* Chat privado: sólo el historial se desplaza; el compositor permanece visible. */
.com-chat-modal .modal-content{height:min(640px,calc(100dvh - 32px))}
.com-chat-modal .modal-body{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden!important;padding:0!important;background:#F5F7FA}
#com-detalle{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#A78018 #EDF1F6;padding:0 12px 12px}
#com-detalle::-webkit-scrollbar{width:9px}
#com-detalle::-webkit-scrollbar-track{background:#EDF1F6}
#com-detalle::-webkit-scrollbar-thumb{background:#A78018;border:2px solid #EDF1F6;border-radius:6px}
.com-chat-mensajes{display:flex;flex-direction:column;gap:10px}
.com-chat-summary{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:8px;background:#F5F7FA;padding:9px 0;border-bottom:1px solid #E3D7B5;color:#64748B;font-size:11px}
.com-chat-burbuja{max-width:86%;min-width:130px;padding:9px 11px;border:1px solid #DED6C2;border-radius:10px;box-shadow:0 1px 2px #00387508}
.com-chat-propia{align-self:flex-end;background:#E8F0FC;border-color:#BDCEE6;border-bottom-right-radius:3px}
.com-chat-recibida{align-self:flex-start;background:#FFF;border-bottom-left-radius:3px}
.com-chat-autor{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:11px;color:#003875}
.com-chat-autor small{font-size:10px;white-space:nowrap;margin:0;color:#718096}
.com-chat-burbuja .com-texto{margin:5px 0 0;font-size:12px;line-height:1.45}
.com-chat-contexto{margin-top:8px;padding-top:6px;border-top:1px solid #CFD9E5;font-size:11px}
.com-chat-evento{align-self:center;max-width:95%;border-radius:6px;background:#ECF0F5;color:#66748B;font-size:11px;padding:5px 8px;text-align:center}
.com-chat-evento .com-texto{font-size:11px}
.com-chat-evento small{display:block;font-size:10px;margin:3px 0 0}
.com-chat-modal .modal-footer{display:block;flex-shrink:0;background:#FFF;padding:10px 12px}
.com-chat-composer{display:flex;align-items:flex-end;gap:8px}
.com-chat-composer #com-respuesta{flex:1;min-width:0;height:44px;min-height:44px!important;max-height:120px;resize:vertical}
.com-chat-composer .btn{flex:0 0 auto;height:32px}
.com-chat-pie{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px}
.com-chat-pie small{margin:0;font-size:10px}
#com-error-detalle:empty{display:none}
@media(max-width:550px){.com-chat-burbuja{max-width:94%}.com-chat-autor{flex-wrap:wrap;gap:2px 6px}.com-chat-summary{flex-wrap:wrap}.com-chat-modal .modal-footer{padding:8px}}

/* Prioridad al registrar; controles de estado a la vista en el propio chat. */
.com-form-top>.com-form-titulo{grid-column:1/-1;max-width:440px}
@media(max-width:550px){.com-form-top>.com-form-titulo{max-width:none}}

/* Avisos personales de comunicaciones, visibles también con sidebar compacto. */
.com-sidebar-badge{display:inline-flex;align-items:center;justify-content:center;justify-self:end;grid-column:3;flex-shrink:0;min-width:18px;height:18px;padding:0 4px;border-radius:10px;background:#F5CB57;color:#172C49;font-size:10px;font-weight:700;line-height:1;border:1px solid #FFE6A1;box-sizing:border-box}
.com-sidebar-badge[hidden]{display:none!important}
.com-sidebar-badge-compact{position:absolute;top:1px;right:1px;min-width:16px;height:16px;padding:0 3px;font-size:9px}
.com-tabla tr.com-row-unread>td{background:#FFFCF2}
.com-tabla tr.com-row-unread>td:first-child{border-left:3px solid #C9A227}
.com-tabla tr.com-row-unread>td:first-child>strong{color:#003875}

/* Dos bandejas claras; el chat se reserva únicamente para conversar. */
.com-type-tabs{margin:12px 0 0;max-width:440px}
.com-type-tab{padding:7px 12px!important;min-height:32px!important;border:1px solid #D6C38E!important;background:#F8FAFC!important;color:#52647C!important;font-size:12px!important;font-weight:600!important;border-radius:6px 6px 0 0!important}
.com-type-tab-active{background:#FFF9E8!important;color:#003875!important;border-bottom:3px solid #C9A227!important}
.com-row-state-editor{min-width:90px;font-size:12px}
.com-row-state-editor summary{cursor:pointer;list-style:none;width:fit-content}
.com-row-state-editor summary::-webkit-details-marker{display:none}
.com-row-state-editor summary:focus-visible{outline:2px solid #C9A227;outline-offset:2px}
.com-row-state-editor[open]{min-width:185px;max-width:210px;white-space:normal}
.com-row-state-editor[open] summary{margin-bottom:6px}
.com-row-state-editor .dash-dropdown{margin:6px 0}
.com-row-state-editor textarea.form-control{height:62px;min-height:62px!important;resize:vertical;white-space:normal;margin:6px 0}
.com-row-state-editor>.btn{margin-top:5px}
.com-row-state-editor .Select-menu-outer{position:relative;top:auto}
.com-chat-modal .modal-content{height:auto;border-radius:10px!important}
.com-chat-modal .modal-body{flex:0 1 auto}
.com-chat-modal #com-detalle{flex:0 1 auto;max-height:min(350px,calc(100dvh - 200px));min-height:90px}

/* Contenedores explícitos dbc: evitar el scroll global de modal/dialog/body. */
body.modal-open .modal.show:has(.com-chat-content){display:flex!important;align-items:center;justify-content:center;overflow:hidden!important;height:100dvh;scrollbar-width:none}
body.modal-open .com-chat-dialog{box-sizing:border-box;width:calc(100% - 32px)!important;max-width:580px!important;min-height:0!important;max-height:calc(100dvh - 32px)!important;margin:16px auto!important;overflow:hidden!important}
body.modal-open .com-chat-content{display:flex;flex-direction:column;height:auto!important;min-height:0;max-height:calc(100dvh - 32px)!important;overflow:hidden!important}
body.modal-open .com-chat-content .modal-body{display:flex;flex-direction:column;flex:0 1 auto;min-height:0;overflow:hidden!important;padding:0!important;scrollbar-gutter:auto}
body.modal-open .com-chat-content :is(.modal-header,.modal-footer){flex:0 0 auto;overflow:hidden!important}
body.modal-open .com-chat-content #com-detalle{box-sizing:border-box;min-height:90px;max-height:min(350px,calc(100dvh - 210px));overflow-y:auto!important;overflow-x:hidden!important;background:#E8E3DC}
.com-chat-content .com-chat-summary{background:#E8E3DC;color:#4E5B65;border-bottom-color:#C7BCAC}
.com-chat-content .com-chat-propia{background:#DCF8C6;border-color:#A6CC92;color:#18351E}
.com-chat-content .com-chat-recibida{background:#FFF;border-color:#C2C8CD;color:#243746}
.com-chat-content .com-chat-propia .com-chat-autor{color:#245C34}
.com-chat-content .com-chat-autor small{color:#5F6C65}
.com-chat-content .com-chat-evento{background:#F5F3EF;color:#4E5B65;border:1px solid #D5CFC5}
