/* ===== Informes (pestañas, acotacion y resultado) ===== */

.cc-inf-pagina {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-top: .75rem;
}

/* Panel con el arbol de informes */
.cc-inf-panel {
    flex: 0 0 280px;
    border: 2px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
    max-height: 80vh;
    overflow: auto;
}
.cc-inf-panel-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem .75rem;
    font-weight: bold;
    color: white;
    background-color: rgb(234, 127, 54);
    border-radius: 8px 8px 0 0;
}
.cc-inf-cerrar-panel { background: none; border: 0; color: white; }
.cc-inf-arbol { padding: .5rem; }
.cc-inf-arbol ul { list-style: none; padding-left: 1rem; margin: 0; }
.cc-inf-arbol > ul { padding-left: 0; }
.cc-inf-arbol button { background: none; border: 0; padding: .2rem .25rem; text-align: left; width: 100%; border-radius: 4px; }
.cc-inf-arbol button:hover { background: rgba(232,128,54,.12); }
.cc-inf-arbol .cc-informe-sel { background: rgba(232,128,54,.25); font-weight: 600; }
.cc-inf-arbol .cc-carpeta { font-weight: 600; }

/* Zona de trabajo con las pestañas */
.cc-inf-trabajo { flex: 1 1 auto; min-width: 0; }
.cc-inf-pestanas-barra { display: flex; justify-content: flex-start; margin-bottom: .25rem; }
.cc-inf-pestanas .dxbl-tabs-content { padding-top: .75rem; }

/* Acotacion */
.cc-inf-acotacion {
    border: 2px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
    padding: 1rem 1.25rem;
    max-width: 900px;
}
.cc-inf-seccion { margin-bottom: 1rem; }
.cc-inf-seccion-titulo {
    color: rgb(234, 127, 54);
    font-weight: bold;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e2e2e2;
    margin-bottom: .5rem;
    padding-bottom: .15rem;
}
.cc-inf-rapidas { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.cc-inf-campos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem 1.25rem;
}
.cc-inf-campo label { display: block; font-size: .85rem; color: #555; margin-bottom: .1rem; }
.cc-inf-campo .cc-combo-estadistica { width: 100%; }
.cc-inf-checks { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.cc-inf-acciones { display: flex; align-items: center; margin-top: .5rem; }

/* Resultado */
.cc-inf-barra {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.cc-inf-barra-texto { flex: 1 1 250px; min-width: 0; }
.cc-inf-barra-botones { display: flex; gap: .35rem; }
.cc-inf-tiempos { font-size: .75rem; color: #999; }
.cc-inf-tabla { max-height: 70vh; }
.cc-inf-visor { width: 100%; height: 75vh; border: 1px solid #ddd; border-radius: 6px; }

/* Movil: panel encima, una columna */
@media (max-width: 991.98px) {
    .cc-inf-pagina { flex-direction: column; }
    .cc-inf-panel { flex: none; width: 100%; max-height: 50vh; }
    .cc-inf-campos { grid-template-columns: minmax(0, 1fr); }
    .cc-inf-acotacion { padding: .75rem; }
}

/* Empresas sin conexion (aviso en naranja) */
.cc-inf-sinconexion {
    margin-top: .35rem;
    padding: .25rem .5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: .85rem;
    color: rgb(194, 92, 22);
    background-color: rgba(234, 127, 54, .15);
    border-left: 4px solid rgb(234, 127, 54);
}

/* Selector de empresas por agrupaciones */
.cc-inf-empresas { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cc-inf-empresas .cc-combo-estadistica { min-width: 280px; max-width: 420px; flex: 1 1 280px; }

/* Selector multiple de empresas / agrupaciones */
.cc-inf-tagbox { min-width: 320px; flex: 1 1 420px; max-width: 760px; }

/* Generando informe (la acotacion queda oculta hasta que termine o se cancele) */
.cc-inf-generando {
    border: 2px solid rgb(234, 127, 54);
    border-radius: 10px;
    background-color: #fdf6f1;
    padding: 1rem 1.25rem;
    max-width: 900px;
}
.cc-inf-generando-cab { display: flex; align-items: center; font-weight: bold; color: rgb(194, 92, 22); margin-bottom: .5rem; }

/* Barra vertical para mostrar / ocultar el arbol de informes */
.cc-inf-pagina { align-items: stretch; }
.cc-inf-panel, .cc-inf-trabajo { align-self: flex-start; }
.cc-inf-barra-arbol {
    flex: 0 0 22px;
    align-self: stretch;
    min-height: 220px;
    margin: 0 -.5rem;
    border: 0;
    border-radius: 6px;
    background-color: #eee;
    color: rgb(234, 127, 54);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: .75rem;
    padding: .6rem 0;
    cursor: pointer;
}
.cc-inf-barra-arbol:hover { background-color: rgba(234, 127, 54, .2); }
.cc-inf-barra-arbol.abierto { background-color: transparent; }
.cc-inf-barra-arbol.abierto:hover { background-color: rgba(234, 127, 54, .15); }
.cc-inf-barra-arbol-texto {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: bold;
    font-size: .75rem;
    letter-spacing: .15em;
}
@media (max-width: 991.98px) {
    .cc-inf-barra-arbol { flex: none; min-height: 0; margin: 0; flex-direction: row; justify-content: center; padding: .3rem; }
    .cc-inf-barra-arbol-texto { writing-mode: horizontal-tb; transform: none; }
    .cc-inf-barra-arbol .oi-chevron-left { transform: rotate(90deg); }
    .cc-inf-barra-arbol .oi-chevron-right { transform: rotate(90deg); }
}

/* Mantenimiento de informes: editor del JSON */
.cc-inf-json textarea { font-family: Consolas, "Courier New", monospace; font-size: .8rem; white-space: pre; }

/* Informe resumen: tablas pequeñas, varias por fila si caben */
.cc-inf-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 36rem), 1fr));
    gap: 1rem 1.25rem;
    align-items: start;
    padding: .5rem 0 1rem;
}
.cc-inf-resumen-seccion {
    min-width: 0;
}
.cc-inf-resumen-seccion-ancha {
    grid-column: 1 / -1;
}
.cc-inf-resumen-titulo {
    font-weight: 700;
    color: rgb(234, 127, 54);
    border-bottom: 2px solid rgb(234, 127, 54);
    margin-bottom: .35rem;
    padding-bottom: .1rem;
}

/* ---------- Primera pestaña: catalogo de informes (arbol / lista / favoritos) ---------- */
.cc-inf-catalogo { min-height: 50vh; }
.cc-inf-catalogo-barra { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; }
.cc-inf-vistas { display: inline-flex; border: 1px solid #ccc; border-radius: 8px; overflow: hidden; }
.cc-inf-vista { background: #f7f7f7; border: 0; border-right: 1px solid #ccc; padding: .35rem .9rem; color: #444; }
.cc-inf-vista:last-child { border-right: 0; }
.cc-inf-vista:hover { background: rgba(234, 127, 54, .12); }
.cc-inf-vista.activa { background: rgb(234, 127, 54); color: white; font-weight: 600; }
.cc-inf-num { display: inline-block; margin-left: .35rem; padding: 0 .4rem; border-radius: 8px; font-size: .75rem; background: rgba(0,0,0,.12); }
.cc-inf-buscar { flex: 0 1 320px; min-width: 200px; }
.cc-inf-expandir .cc-inf-cerrar-panel { color: #666; }
.cc-inf-expandir .cc-inf-cerrar-panel:hover { color: rgb(234, 127, 54); }

/* Arbol a todo el ancho: las carpetas de primer nivel en columnas si caben */
.cc-inf-catalogo .cc-inf-arbol > ul { column-width: 380px; column-gap: 2rem; }
.cc-inf-catalogo .cc-inf-arbol > ul > li { break-inside: avoid; margin-bottom: .5rem; }
.cc-inf-arbol-informe { display: flex; align-items: center; }
.cc-inf-arbol .cc-inf-arbol-informe button:not(.cc-inf-estrella) { flex: 1 1 auto; width: auto; }

/* Estrella de favorito */
.cc-inf-estrella, .cc-inf-arbol .cc-inf-estrella { background: none; border: 0; width: auto; padding: 0 .3rem; color: #c8c8c8; flex: 0 0 auto; }
.cc-inf-estrella:hover, .cc-inf-arbol .cc-inf-estrella:hover { color: rgb(234, 127, 54); background: none; }
.cc-inf-estrella.marcada { color: rgb(234, 127, 54); }
.cc-inf-estrella-ej { color: rgb(234, 127, 54); }

/* Lista agrupada por las carpetas del árbol */
.cc-inf-lista,
.cc-inf-subcategorias {
    display: grid;
    gap: .75rem;
    align-items: start;
}
.cc-inf-lista { grid-template-columns: repeat(auto-fit, minmax(min(100%, 36rem), 1fr)); }
.cc-inf-categoria {
    min-width: 0;
    padding: .75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f7f7f7;
}
.cc-inf-categoria-titulo {
    margin: 0 0 .75rem;
    padding: .2rem 0 .2rem .6rem;
    border-left: 3px solid rgb(234, 127, 54);
    color: #333;
    font-size: 1.1rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.cc-inf-subcategorias { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.cc-inf-subcategoria {
    min-width: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
}
.cc-inf-subcategoria-titulo {
    padding: .45rem .65rem;
    border-bottom: 1px solid #eee;
    border-radius: 5px 5px 0 0;
    background: #fff5ed;
    color: #713c1e;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.cc-inf-subcategoria-anidada { margin: .4rem 0 .4rem .55rem; border-left: 1px solid #e0e0e0; }
.cc-inf-lista-informes { list-style: none; padding: 0; margin: 0; }
.cc-inf-lista-informes li { display: flex; align-items: stretch; }
.cc-inf-lista-informes li + li { border-top: 1px solid #eee; }
.cc-inf-lista-informes li:hover { background: rgba(234, 127, 54, .08); }
.cc-inf-lista-informes li.abierto { background: rgba(234, 127, 54, .18); }
.cc-inf-lista-informes .cc-inf-estrella { width: 2.2rem; }
.cc-inf-lista-informes .cc-inf-estrella:not(.marcada):not(:hover) { color: #777; }
.cc-inf-lista-abrir {
    flex: 1;
    min-width: 0;
    padding: .4rem .6rem .4rem 0;
    border: 0;
    background: transparent;
    color: #333;
    text-align: left;
    overflow-wrap: anywhere;
}
.cc-inf-lista-informes .abierto .cc-inf-lista-abrir { font-weight: 600; }
.cc-inf-lista-informes button:focus-visible { outline: 2px solid #a44920; outline-offset: -2px; }

/* Favoritos: tarjetas */
/* Una caja por carpeta (grupo) con sus informes favoritos dentro */
.cc-inf-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; align-items: start; }
.cc-inf-tarjeta-grupo { border: 1px solid #ddd; border-left: 4px solid rgb(234, 127, 54); border-radius: 8px;
                        background: #fafafa; padding: .45rem .3rem .3rem .3rem; }
.cc-inf-tarjeta-carpeta { font-size: .8rem; color: #777; padding: 0 .5rem .3rem .5rem; margin-bottom: .2rem;
                          border-bottom: 1px solid #e6e6e6; }
.cc-inf-tarjeta { position: relative; border-radius: 6px; padding: .35rem 2rem .35rem .5rem; cursor: pointer; }
.cc-inf-tarjeta:hover { background: rgba(234, 127, 54, .08); }
.cc-inf-tarjeta.abierto { background: rgba(234, 127, 54, .15); }
.cc-inf-tarjeta .cc-inf-estrella { position: absolute; top: 50%; transform: translateY(-50%); right: .3rem; }
.cc-inf-tarjeta-nombre { font-weight: 600; }

/* Vista Lista: cajas plegables */
.cc-inf-caja-boton { display: flex; align-items: center; gap: .4rem; width: 100%; background: none; border: 0; padding: 0;
                     color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cc-inf-caja-boton:hover { color: rgb(234, 127, 54); }
.cc-inf-caja-flecha { font-size: .7em; flex: 0 0 auto; color: rgb(234, 127, 54); }
.cc-inf-caja-num { margin-left: auto; padding: 0 .45rem; border-radius: 8px; background: rgba(0,0,0,.07);
                   color: #777; font-size: .75rem; font-weight: 600; }
.cc-inf-categoria.plegada .cc-inf-categoria-titulo { margin-bottom: 0; }

/* Cierres Z por día */
.filtros-cierres {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
}

.empresas-cierres {
    flex: 1 1 26rem;
    min-width: 0;
}

.empresas-cierres .cc-inf-tagbox {
    min-width: 0;
    width: 100%;
}

.cierres-z {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr));
    align-items: start;
    gap: 1rem;
}

.cierre-z {
    min-width: 0;
    padding: .9rem;
    border: 1px solid #d8d8d8;
    border-top: 3px solid rgb(234, 127, 54);
    border-radius: 8px;
    background: var(--bs-body-bg, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}

.cierre-z h3 {
    margin: 0;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.cierre-z > p {
    margin: .2rem 0 .65rem;
}

.cierre-z pre {
    margin: 0;
    padding-top: .65rem;
    border-top: 1px dashed #aaa;
    overflow-x: auto;
    white-space: pre;
    font: .85rem/1.35 Consolas, "Courier New", monospace;
    color: inherit;
}
