/* Contadores de texto globales sin alterar la estructura de los formularios. */
.xentory-text-field-counter {
    position: fixed;
    z-index: 2147482500;
    display: none;
    min-width: 25px;
    max-width: 92px;
    margin: 0;
    padding: 1px 4px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 4px;
    color: #687789;
    background: rgba(248, 250, 252, .92);
    box-shadow: none;
    font-family: inherit;
    font-size: 8px;
    font-weight: 500;
    line-height: 1.15;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    opacity: .78;
}

.xentory-text-field-counter.is-visible {
    display: block;
}

.xentory-text-field-counter.is-over-limit,
.xentory-description-field > .contador-descripcion.is-over-limit {
    border-color: rgba(220, 38, 38, .3);
    color: #b42318;
    background: rgba(254, 242, 242, .94);
    opacity: .96;
}

input.xentory-text-counter-active,
textarea.xentory-text-counter-active {
    padding-right: 54px !important;
}

textarea.xentory-text-counter-active {
    padding-bottom: 18px !important;
}

html[data-theme="dark"] .xentory-text-field-counter,
body.dark-mode .xentory-text-field-counter {
    border-color: rgba(148, 163, 184, .22);
    color: #afbdcc;
    background: rgba(15, 23, 42, .9);
}

/* Contador persistente de Descripcion dentro de las partidas documentales. */
.xentory-description-field {
    position: relative;
    width: 100%;
    min-width: 0;
}

.xentory-description-field > input.descripcion {
    width: 100%;
    padding-right: 54px !important;
}

.xentory-description-field > .contador-descripcion {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 5px;
    min-width: 39px;
    margin: 0;
    padding: 1px 3px;
    border: 0;
    border-radius: 4px;
    color: #7b8794;
    background: rgba(248, 250, 252, .9);
    box-shadow: none;
    font-size: 8px;
    font-weight: 500;
    line-height: 1.1;
    text-align: right;
    white-space: nowrap;
    pointer-events: none;
    opacity: .72;
    transform: translateY(-50%);
    transition: color .15s ease, opacity .15s ease;
}

.xentory-description-field > input.descripcion:focus + .contador-descripcion {
    color: #526273;
    opacity: .92;
}

html[data-theme="dark"] .xentory-description-field > .contador-descripcion,
body.dark-mode .xentory-description-field > .contador-descripcion {
    color: #a8b7c8;
    background: rgba(15, 23, 42, .86);
}

@media print {
    .xentory-text-field-counter,
    .xentory-description-field > .contador-descripcion {
        display: none !important;
    }
}
