.pantalla-operativa {
    width: min(100%, 860px);
}

.cabecera-operativa {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.cabecera-operativa h1 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    letter-spacing: -0.03em;
}

.modulo-etiqueta {
    margin: 0;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btn-volver,
.candado-admin {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(24, 24, 27, 0.85);
    color: var(--text-muted);
    text-decoration: none;
}

.btn-volver {
    font-size: 1.4rem;
    transition:
        border-color 0.2s ease,
        color 0.2s ease;
}

.btn-volver:hover {
    border-color: rgba(196, 140, 83, 0.5);
    color: var(--accent);
}

.candado-admin {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(24, 24, 27, 0.85);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.72;
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        color 0.18s ease,
        opacity 0.18s ease;
}

.candado-admin:hover {
    border-color: rgba(196, 140, 83, 0.5);
    color: var(--accent);
    opacity: 1;
}

.candado-admin svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.panel-operativo {
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(24, 24, 27, 0.96);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45),
        0 0 60px rgba(196, 140, 83, 0.035);
}

.alerta {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alerta p {
    margin: 0.35rem 0 0;
}

.alerta ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.alerta-exito {
    border-color: rgba(97, 201, 149, 0.32);
    background: rgba(97, 201, 149, 0.08);
    color: #a4e4c3;
}

.alerta-error {
    border-color: rgba(239, 100, 100, 0.32);
    background: rgba(239, 100, 100, 0.08);
    color: #ffb0b0;
}

.alerta-advertencia {
    border-color: rgba(227, 168, 87, 0.4);
    background: rgba(227, 168, 87, 0.09);
    color: #f4c989;
}

.zona-escaner {
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(196, 140, 83, 0.25);
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            rgba(196, 140, 83, 0.09),
            rgba(196, 140, 83, 0.025)
        );
}

.zona-escaner > div:first-child {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.zona-escaner h2 {
    margin: 0;
    font-size: 1rem;
}

.zona-escaner p {
    margin: 0.3rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.indicador-escaner {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    margin-top: 0.3rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(196, 140, 83, 0.75);
}

.escaner-controles {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    margin-top: 1rem;
}

.input-escaner,
.campo input,
.campo select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: #111114;
    color: var(--text-main);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.input-escaner {
    padding: 0 1rem;
    border-color: rgba(196, 140, 83, 0.3);
}

.input-escaner:focus,
.campo input:focus,
.campo select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 140, 83, 0.11);
}

.btn-secundario {
    min-height: 48px;
    padding: 0 1.1rem;
    border: 1px solid rgba(196, 140, 83, 0.3);
    border-radius: 9px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-weight: 700;
}

.btn-secundario:hover {
    background: rgba(196, 140, 83, 0.08);
}

.estado-lector[data-tipo="exito"] {
    color: var(--success);
}

.estado-lector[data-tipo="error"] {
    color: var(--danger);
}

.estado-lector[data-tipo="advertencia"] {
    color: var(--warning);
}

fieldset {
    min-width: 0;
    margin: 0 0 1.5rem;
    padding: 0;
    border: 0;
}

legend {
    width: 100%;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.grilla-formulario {
    display: grid;
    grid-template-columns: 0.8fr 1fr 1fr;
    gap: 1rem;
}

.grilla-ingreso {
    grid-template-columns: 1fr 1fr;
}

.campo {
    min-width: 0;
}

.campo label {
    display: block;
    margin-bottom: 0.45rem;
    color: #d4d4d8;
    font-size: 0.84rem;
    font-weight: 600;
}

.campo label span {
    margin-left: 0.25rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 400;
}

.campo input,
.campo select {
    padding: 0 0.9rem;
}

.campo input::placeholder {
    color: #5c5c64;
}

.acciones-formulario {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.btn-registrar,
.btn-cancelar {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.4rem;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

.btn-registrar {
    flex: 1;
    max-width: 390px;
    border: 0;
    background: var(--accent);
    color: var(--bg-body);
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        transform 0.18s ease,
        opacity 0.18s ease;
}

.btn-registrar:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-registrar:disabled {
    cursor: wait;
    opacity: 0.65;
}

.btn-cancelar {
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-cancelar:hover {
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-main);
}

@media (max-width: 700px) {
    body {
        padding: 1rem;
        align-items: flex-start;
    }

    .grilla-formulario,
    .grilla-ingreso {
        grid-template-columns: 1fr;
    }

    .escaner-controles {
        grid-template-columns: 1fr;
    }

    .acciones-formulario {
        flex-direction: column-reverse;
    }

    .btn-registrar {
        width: 100%;
        max-width: none;
    }
}

.form-egreso {
    width: min(100%, 540px);
    margin: 0 auto;
}

.form-egreso .campo input {
    min-height: 58px;
    font-size: 1.2rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-align: center;
}

.form-egreso .acciones-formulario {
    justify-content: center;
}

.form-egreso .btn-registrar {
    max-width: none;
}

.instruccion-egreso {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    text-align: center;
}

.campo-error {
    margin: 0.5rem 0 0;
    color: var(--danger);
    font-size: 0.8rem;
}

.resultado-egreso {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 1px solid rgba(97, 201, 149, 0.32);
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            rgba(97, 201, 149, 0.1),
            rgba(97, 201, 149, 0.025)
        );
}

.resultado-egreso h2 {
    margin: 0;
    color: #a4e4c3;
    font-size: 1rem;
}

.resultado-egreso > p {
    margin: 0.35rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.resultado-detalles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 0;
}

.resultado-detalles div {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(9, 9, 11, 0.35);
}

.resultado-detalles dt {
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.resultado-detalles dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 560px) {
    .resultado-detalles {
        grid-template-columns: 1fr;
    }
}