body { 
    min-height: 100vh; min-height: 100dvh; 
    min-height: -webkit-fill-available;
    display: flex; 
    flex-direction: column; 
    background-color: var(--fundo); 
    overflow-x: hidden; 
    position: relative; 
    width: 100%;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.container {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 20px 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    min-width: 0;
}

/* HEADER */

.header-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    background: white;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--borda);
    border-left: 5px solid var(--azul-caixa);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    z-index: 2;
}

.header-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.header-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--azul-caixa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.header-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 38px;
    border: 1.5px solid var(--borda);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--texto);
    outline: none;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.header-input:focus {
    border-color: var(--laranja-caixa);
    box-shadow: 0 0 0 3px rgba(240, 130, 0, 0.1);
}

select.header-input {
    text-align-last: left;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300366D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
}

input[type="date"].header-input {
    min-height: 38px;
    line-height: 38px;
}

/* GRID */
.grid-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    border: 1px solid var(--borda);
    background-color: white;
    grid-auto-rows: 40px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cell { display: flex; align-items: center; justify-content: center; position: relative; border-bottom: 1px solid var(--borda-sutil); overflow: hidden; }
.c1 { border-right: 1px solid var(--borda-forte); justify-content: flex-start; padding-left: 12px; }
.c2 { border-right: 1px solid var(--borda-forte); }
.span-2-rows { grid-row: span 2; border-right: 1px solid var(--borda-forte); }

.row-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    line-height: 1.1;
    display: flex;
    align-items: center;
}

.col-header {
    background-color: var(--azul-caixa);
    color: white !important;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--laranja-caixa) !important;
    justify-content: center !important;
    letter-spacing: 0.5px;
}

.col-header.c1,
.col-header.c2 {
    border-right-color: rgba(255, 255, 255, 0.2) !important;
}

input.field {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--texto);
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: background-color 0.2s;
}

input.field:focus { background-color: #f0fdf4; }

.gray-bg {
    background-color: var(--fundo-sutil);
    color: var(--texto-secundario);
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
    justify-content: center !important;
    padding: 0 !important;
    text-transform: uppercase;
}

.desc-input::placeholder { font-size: 0.65rem; color: #94a3b8; font-style: italic; text-align: center; }
.desc-input { text-align: center !important; padding: 0 !important; }

.saldo-label {
    background-color: var(--fundo-sutil);
    color: var(--azul-caixa);
    font-weight: 900;
    font-size: 0.85rem;
    border-top: 1px solid var(--borda-forte);
    border-bottom: none;
}

.saldo-value {
    grid-column: span 2;
    border-top: 1px solid var(--borda-forte);
    border-bottom: none;
    padding: 0;
}

#saldo-display {
    font-size: 1.15rem;
    font-weight: 900;
    text-align: center;
    width: 100%;
    height: 100%;
    border: none;
    color: var(--azul-caixa);
    background: transparent;
    outline: none;
}

.no-bottom-border { border-bottom: none !important; }

/* BOTÃO */
.btn-container { padding: 10px 0; background: transparent; flex-shrink: 0; }

.modal-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.modal-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--azul-caixa); }
.modal-input {
    width: 100%; padding: 12px; border: 2px solid var(--borda);
    font-size: 1.1rem; font-weight: 700; text-align: center; border-radius: var(--radius-sm);
    transition: all 0.2s; background: white; color: var(--texto);
}
.modal-input:focus { outline: none; border-color: var(--laranja-caixa); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

/* Estado "processando" do botão Confirmar: legível, linha única e com spinner */
.btn-confirmar[aria-busy="true"],
.btn-confirmar[aria-busy="true"]:disabled {
    background-color: var(--azul-caixa);
    color: #ffffff;
    box-shadow: none;
    cursor: progress;
    text-transform: none;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0;
    padding-left: 12px;
    padding-right: 12px;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
}
.btn-confirmar[aria-busy="true"] .btn-status-texto {
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.modal-actions .btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.modal-guide-container {
    background: #fffdfa;
    border: 1px solid var(--borda-sutil);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-bottom: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.modal-guide-img {
    width: 100%;
    max-height: 125px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}
.modal-guide-hint {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.guide-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.guide-tab {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    border: 1px solid var(--borda);
    border-radius: var(--radius-sm);
    background: var(--fundo-sutil);
    color: var(--texto-secundario);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.guide-tab.active {
    background: var(--azul-caixa);
    color: white;
    border-color: var(--azul-caixa);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.guide-tab:hover:not(.active) {
    background: var(--fundo-hover);
    color: var(--texto);
}
.modal-label-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.badge-pix-pagamento,
.badge-pix-saque,
.badge-comissao {
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.badge-pix-pagamento { background: #c2410c; }
.badge-pix-saque { background: #9333ea; }
.badge-comissao { background: #0369a1; }
.input-pix-pagamento {
    border-color: #fdba74 !important;
}
.input-pix-pagamento:focus {
    border-color: #ea580c !important;
    background-color: #fff7ed !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15) !important;
}
.input-pix-saque {
    border-color: #d8b4fe !important;
}
.input-pix-saque:focus {
    border-color: #9333ea !important;
    background-color: #faf5ff !important;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15) !important;
}
.input-comissao {
    border-color: #7dd3fc !important;
}
.input-comissao:focus {
    border-color: #0284c7 !important;
    background-color: #f0f9ff !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.hub-modal-overlay.active {
    display: flex !important;
}

/* BANNER E SLOTS DE COMPROVANTES FOTOGRÁFICOS */
.banner-comprovantes {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border: 1.5px solid #86efac;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}
.bc-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.bc-icon {
    width: 40px; height: 40px; background: #16a34a; color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; flex-shrink: 0;
}
.bc-title { font-size: 0.88rem; font-weight: 800; color: #166534; line-height: 1.2; }
.bc-subtitle { font-size: 0.72rem; color: #475569; font-weight: 600; word-break: break-word; overflow-wrap: break-word; margin-top: 2px; }
.btn-abrir-comprovantes {
    background: #16a34a; color: white; border: none; padding: 8px 14px;
    border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 800;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    flex-shrink: 0;
}
.btn-abrir-comprovantes:hover { background: #15803d; }

.slots-comprovantes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 12px 0;
}
.slot-card {
    background: white; border: 1.5px dashed var(--borda); border-radius: var(--radius-md);
    padding: 12px; text-align: center; display: flex; flex-direction: column;
    align-items: center; justify-content: space-between; transition: all 0.2s;
    position: relative;
}
.slot-card:hover { border-color: #0284c7; }
.slot-card.selected {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.35);
    background: #f0f9ff !important;
}
.slot-card.drag-over {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.15) !important;
    transform: scale(1.02);
}
.slot-card.anexado {
    border-style: solid; border-color: #10b981; background: #f0fdf4;
}
/* Card já anexado e selecionado (alvo do Ctrl+V): mantém o verde, sinaliza apenas com anel */
.slot-card.anexado.selected {
    border-color: #10b981 !important;
    background: #f0fdf4 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
}
.slot-info-box {
    width: 100%; display: flex; flex-direction: column; align-items: center; order: 1;
}
.slot-title-row {
    width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 4px 6px; position: relative; margin-bottom: 6px;
}
.slot-header-title {
    font-size: 0.78rem; font-weight: 800; color: var(--azul-caixa); margin: 0;
}
.slot-hint-text {
    display: none;
}
.paste-badge-modal {
    font-size: 0.62rem; font-weight: 700; color: #0369a1; background: #e0f2fe;
    padding: 2px 6px; border-radius: 4px; margin-bottom: 6px;
    display: inline-flex; align-items: center; gap: 4px;
}
.slot-thumb-wrap {
    position: relative; width: 100%; height: 95px; margin-bottom: 8px; order: 2;
    display: flex; align-items: center; justify-content: center;
}
.slot-img-preview {
    width: 100%; height: 95px; object-fit: contain; background: #fafafa;
    border-radius: 4px; border: 1px solid var(--borda-sutil); margin-bottom: 0;
}
.slot-thumb-remove {
    display: none !important; position: absolute; top: -7px; right: -7px;
    width: 22px; height: 22px; border-radius: 50%;
    background: #ef4444; color: #ffffff; border: 2px solid #ffffff;
    align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25); padding: 0; margin: 0; z-index: 5;
    box-sizing: border-box;
    transition: transform 0.15s, background 0.15s;
}
.slot-thumb-remove svg { display: block; width: 10px; height: 10px; pointer-events: none; }
.slot-thumb-remove:hover { background: #dc2626; transform: scale(1.08); }
.slot-card.anexado .slot-thumb-remove { display: flex !important; }
.slot-thumb-rotate {
    display: none !important; position: absolute; bottom: -6px; right: -6px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--azul-caixa); color: #ffffff; border: 2px solid #ffffff;
    align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25); padding: 0; margin: 0; z-index: 5;
    box-sizing: border-box; font-size: 9px;
    transition: transform 0.15s, background 0.15s;
}
.slot-thumb-rotate:hover { background: #002752; transform: scale(1.08); }
.slot-card.anexado .slot-thumb-rotate { display: flex !important; }
.slot-btns-group {
    display: flex; gap: 6px; width: 100%; margin-top: 4px; order: 3;
}
.slot-btn-acao {
    flex: 1; padding: 8px 6px; font-size: 0.72rem; font-weight: 750;
    border-radius: var(--radius-sm); cursor: pointer; display: flex;
    align-items: center; justify-content: center; gap: 4px;
    transition: all 0.15s;
}
.slot-btn-acao.btn-camera { background: var(--azul-caixa); color: white; border: 1px solid var(--azul-caixa); }
.slot-btn-acao.btn-camera:hover { background: #002752; }
.slot-btn-acao.btn-galeria { background: var(--fundo-sutil); color: var(--azul-caixa); border: 1px solid var(--borda-forte); }
.slot-btn-acao.btn-galeria:hover { background: var(--borda-sutil); }
.slot-card.anexado .slot-btn-acao.btn-camera { background: #047857; border-color: #047857; color: white; }
.slot-card.anexado .slot-btn-acao.btn-galeria { border-color: #10b981; color: #047857; background: #ecfdf5; }
.slot-badge-status {
    position: static; font-size: 0.65rem; white-space: nowrap;
    font-weight: 800; padding: 2px 6px; border-radius: 10px;
}
.status-pendente { background: #fee2e2; color: #991b1b; }
.status-ok { background: #d1fae5; color: #065f46; }
.status-obrigatorio { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.status-dispensado { background: var(--fundo-hover); color: #64748b; border: 1px solid var(--borda-sutil); }
.status-opcional { background: var(--fundo-hover); color: #64748b; border: 1px solid var(--borda-forte); }
.status-aguardando { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ====== RESPONSIVIDADE MOBILE (<= 680px) ====== */
@media (max-width: 680px) {
    .slots-comprovantes-grid {
        display: flex;
        flex-direction: column;
        gap: 9px;
        margin: 8px 0;
    }
    .slot-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 8px 10px;
        text-align: left;
        border-radius: 12px;
        gap: 8px;
        min-height: 72px;
    }
    .slot-thumb-wrap {
        width: 44px;
        height: 58px;
        margin: 0;
        flex-shrink: 0;
        order: 1;
        position: relative;
    }
    .slot-img-preview {
        width: 44px;
        height: 58px;
        object-fit: contain;
        margin: 0;
        flex-shrink: 0;
        border: 1px solid var(--borda-forte);
        border-radius: 8px;
        background: #fff;
        padding: 2px;
        cursor: pointer;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    .slot-thumb-remove {
        top: -8px;
        right: -8px;
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    .slot-thumb-rotate {
        bottom: -8px;
        right: -8px;
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    .slot-info-box {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2px;
        order: 2;
        padding-right: 2px;
    }
    .slot-title-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        width: 100%;
        margin: 0;
        position: static;
    }
    .slot-header-title {
        white-space: normal;
        line-height: 1.25;
        word-break: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .slot-badge-status {
        font-size: 0.58rem;
        padding: 1px 6px;
        border-radius: 6px;
        flex-shrink: 0;
        display: inline-block;
    }
    .slot-hint-text {
        display: block;
        font-size: 0.63rem;
        color: #64748b;
        line-height: 1.2;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .paste-badge-modal {
        display: none !important;
    }
    .slot-btns-group {
        flex-direction: column;
        width: auto;
        min-width: 96px;
        gap: 4px;
        margin: 0;
        flex-shrink: 0;
        order: 3;
    }
    .slot-btn-acao {
        padding: 6px 10px;
        font-size: 0.76rem;
        font-weight: 800;
        border-radius: 10px;
        gap: 6px;
        width: 100%;
    }
    .slot-btn-acao i {
        font-size: 0.85rem;
    }
    .slot-btn-acao:active {
        transform: scale(0.96);
    }
    /* Ação principal: alvo de toque de 44px */
    .slot-btn-acao.btn-camera {
        height: 44px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    }
    /* Ação secundária: link discreto com alvo ergonômico >= 34px */
    .slot-btn-acao.btn-galeria,
    .slot-card.anexado .slot-btn-acao.btn-galeria {
        min-height: 34px;
        height: auto;
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        color: var(--azul-caixa);
        font-size: 0.74rem;
        font-weight: 700;
        text-decoration: underline;
        text-underline-offset: 2px;
    }
    .slot-card.anexado .slot-btn-acao.btn-galeria { color: #047857; }
    .slot-btn-acao.btn-galeria:hover { background: rgba(var(--primaria-escura-rgb), 0.06); }

    /* Respiro e ergonomia dos botões de ação e modais no mobile */
    .modal-actions {
        gap: 12px;
        margin-top: 14px;
    }
    .modal-actions button {
        height: 48px !important;
        font-size: 0.92rem;
        font-weight: 800;
        border-radius: 10px;
    }
    .guide-tabs {
        gap: 8px;
        margin-bottom: 12px;
    }
    .guide-tab {
        padding: 10px 8px;
        font-size: 0.82rem;
        font-weight: 750;
        border-radius: 8px;
        min-height: 42px;
    }
}

.btn-opcao-auto {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    color: white; border: none; padding: 15px 16px; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 800; cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    box-shadow: 0 3px 6px rgba(2, 132, 199, 0.3);
    min-height: 54px; width: 100%;
}
.btn-opcao-auto:hover:not(:disabled) {
    background: linear-gradient(135deg, #075985 0%, #0c4a6e 100%);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}
.btn-opcao-auto:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.8); transform: none; }

/* MODAL DE ZOOM DO GUIA VISUAL — TOTALMENTE CENTRALIZADO NO VIEWPORT */
#modal-zoom-guia {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(0, 0, 0, 0.82) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}
#modal-zoom-guia .hub-modal-content {
    margin: auto !important;
    width: 100% !important;
    max-width: 420px !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45) !important;
    border-top: 5px solid var(--laranja-caixa) !important;
    gap: 6px !important;
    box-sizing: border-box !important;
}
#modal-zoom-guia .zoom-img-container {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 180px !important;
    max-height: 72vh !important;
    max-height: 72dvh !important;
    background: #fafafa !important;
    border: 1px solid var(--borda-sutil) !important;
    border-radius: 10px !important;
    padding: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
#modal-zoom-guia #zoom-guia-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: auto !important;
}

/* DESTAQUE VISUAL DE CAMPOS AUTO-PREENCHIDOS */
.field-auto {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15) !important;
}
/* CÂMERA INTERNA DO NAVEGADOR (getUserMedia) — Zero storage no celular */
#modal-camera-interna {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh;
    background: #000; display: none; flex-direction: column; z-index: 999999;
}
#modal-camera-interna.ativo { display: flex; }
#camera-viewfinder {
    flex: 1; width: 100%; height: 100%; object-fit: cover; background: #111;
}
.camera-toolbar {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: center; gap: 32px;
    padding: 18px 24px 28px 24px; padding-bottom: max(28px, env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}
.camera-toolbar button {
    border: none; background: none; cursor: pointer; color: #fff; font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%; transition: all 0.15s;
}
.camera-toolbar button:active { transform: scale(0.9); }
.camera-toolbar .btn-camera-fechar-int {
    background: rgba(255,255,255,0.15); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.camera-toolbar .btn-camera-capturar-int {
    width: 68px; height: 68px; border-radius: 50%;
    background: #fff; border: 4px solid rgba(255,255,255,0.4) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.camera-toolbar .btn-camera-capturar-int i { color: #1e293b; font-size: 1.5rem; }
.camera-toolbar .btn-camera-flash-int {
    background: rgba(255,255,255,0.15); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.camera-toolbar .btn-camera-flash-int.ativo {
    background: rgba(250, 204, 21, 0.35); color: #facc15;
}
.camera-flash-anim {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh;
    background: #fff; z-index: 9999999; pointer-events: none;
    animation: flashCaptura 0.25s ease-out forwards;
}
@keyframes flashCaptura {
    0% { opacity: 0.85; }
    100% { opacity: 0; }
}
.camera-tipo-badge {
    position: absolute; top: 0; left: 0; right: 0;
    padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
    background: linear-gradient(rgba(0,0,0,0.6), transparent);
    color: #fff; font-size: 0.82rem; font-weight: 700; text-align: center;
    letter-spacing: 0.3px; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Campos com código de cor (Laranja/Roxo/Azul) preservam a cor do guia
   quando auto-preenchidos; o "auto" é sinalizado pela etiqueta AUTO no rótulo */
.input-pix-pagamento.field-auto {
    border-color: #ea580c !important; background-color: #fff7ed !important;
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15) !important;
}
.input-pix-saque.field-auto {
    border-color: #9333ea !important; background-color: #faf5ff !important;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.15) !important;
}
.input-comissao.field-auto {
    border-color: #0284c7 !important; background-color: #f0f9ff !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
}
.modal-group:has(.field-auto) .modal-label::after {
    content: "AUTO";
    background: #047857; color: white; font-size: 0.58rem; font-weight: 800;
    padding: 1px 5px; border-radius: 3px; margin-left: 6px; vertical-align: middle;
}

/* ====== RESPONSIVIDADE (no fim do CSS para prevalecer sobre as regras base) ====== */
@media (max-width: 600px) {
    .container { padding: 12px 10px; }
    .header-container { gap: 8px; padding: 10px 14px; }
    .banner-comprovantes { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
    .bc-left { width: 100%; }
    .btn-abrir-comprovantes { width: 100%; justify-content: center; padding: 11px 14px; font-size: 0.88rem; }
}

@media (max-width: 480px) {
    .grid-container { grid-template-columns: 1.25fr 1fr 1fr; }
    .row-label { font-size: 0.65rem; }
    .c1.row-label { padding-left: 6px; }
    .col-header { font-size: 0.68rem; }
    input.field { font-size: 0.8rem; }
    .desc-input::placeholder { font-size: 0.6rem; }
}

@media (max-width: 360px) {
    .grid-container { grid-template-columns: 1.35fr 0.9fr 0.95fr; }
    .row-label { font-size: 0.58rem; }
    .c1.row-label { padding-left: 4px; }
    .col-header { font-size: 0.62rem; }
    input.field { font-size: 0.75rem; }
    .desc-input::placeholder { font-size: 0.55rem; }
}
