/* ===== Reset e variáveis ===== */
:root {
    --azul-institucional: #01468C;
    --azul-escuro: #22385E;
    --grafite: #4A4A4A;
    --cinza-claro: #F5F7FA;
    --cinza-texto: #4B5563;
    --cinza-borda: #E5E7EB;
    --white: #FFFFFF;
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', Arial, sans-serif;
}

body {
    background-color: var(--cinza-claro);
    color: var(--cinza-texto);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    padding-top: 150px;
}

.hidden-file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#draft-banner {
    display: none;
    width: 100%;
    max-width: 900px;
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-left: 4px solid var(--grafite);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 24px;
    border-radius: 8px;
    color: #FFF;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-error {
    background: var(--danger);
    border-left: 4px solid #B91C1C;
}

.toast-success {
    background: var(--success);
    border-left: 4px solid #047857;
}

.toast-info {
    background: var(--azul-institucional);
    border-left: 4px solid var(--azul-escuro);
}

.toast-warning {
    background: var(--grafite);
    border-left: 4px solid #333333;
    color: #FFF;
}

/* ===== Animações e Destasques (Pendências) ===== */
@keyframes campoVibrando {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

@keyframes pulseAlert {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.campo-pendente {
    border: 2px solid #EF4444 !important;
    background: #FEF2F2 !important;
    animation: campoVibrando 0.4s ease-out, pulseAlert 2s infinite;
}

.smart-item.campo-pendente,
.mandatory-slot.campo-pendente,
.signature-container.campo-pendente,
.declaration-box.campo-pendente,
.upload-area.campo-pendente {
    border: 2px solid #EF4444 !important;
}

/* ===== Tela de Login ===== */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--azul-institucional);
    z-index: 99999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo {
    max-width: 180px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.login-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--azul-institucional);
    margin-bottom: 5px;
}

.login-sub {
    font-size: 13px;
    color: var(--cinza-texto);
    margin-bottom: 30px;
}

.login-input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    color: var(--azul-escuro);
    font-weight: bold;
    letter-spacing: 2px;
}

.login-input:focus {
    border-color: var(--azul-institucional);
    outline: none;
    box-shadow: 0 0 0 3px rgba(1, 70, 140, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--azul-institucional);
    color: white;
    font-weight: bold;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.login-btn:hover:not(:disabled) {
    background: var(--azul-escuro);
    transform: translateY(-2px);
}

.login-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
}

.login-msg {
    color: var(--danger);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 15px;
    display: none;
    background: #FEF2F2;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #FECACA;
}

.login-footer {
    margin-top: 30px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-align: center;
}

#login-loader {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Painel de controle fixo ===== */
.control-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    z-index: 10001;
    padding: 15px 20px;
    border-bottom: 1px solid var(--cinza-borda);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.panel-badges {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.network-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    background: var(--success);
    transition: background 0.3s;
}

.network-badge.offline {
    background: var(--danger);
}

.pdf-estimator {
    font-size: 11px;
    font-weight: bold;
    color: var(--grafite);
    background: #F3F4F6;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #D1D5DB;
}

.panel-os {
    font-size: 16px;
    font-weight: 800;
    color: var(--azul-institucional);
}

.panel-bottom {
    background: #F3F4F6;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.progress-wrapper {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--azul-escuro);
}

.missing-badge {
    display: none;
    font-size: 10px;
    font-weight: 800;
    color: #B91C1C;
    background: #FEE2E2;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #FECACA;
    cursor: pointer;
    text-transform: uppercase;
    animation: pulseAlert 2s infinite;
    transition: all 0.2s;
}

.missing-badge:hover {
    background: #FECACA;
    transform: scale(1.05);
}

.progress-track {
    width: 100%;
    height: 24px;
    background: #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-track::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 12px;
    background: var(--grafite);
    border-radius: 12px 0 0 12px;
    z-index: 1;
    transition: opacity 0.3s;
}

.progress-track.has-progress::before {
    opacity: 0;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    border-radius: 12px;
    transition: width 0.4s ease, background-color 0.4s ease;
    position: relative;
    z-index: 2;
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    font-size: 13px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-action:disabled {
    background: #D1D5DB;
    color: #9CA3AF;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#btn-enviar:not(:disabled) {
    background: var(--grafite);
}

#btn-enviar:not(:disabled):hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74, 74, 74, 0.3);
}

#btn-pdf:not(:disabled) {
    background: var(--azul-institucional);
}

#btn-pdf:not(:disabled):hover {
    background: #013770;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(1, 70, 140, 0.3);
}

#btn-wa:not(:disabled) {
    background: #25D366;
}

#btn-wa:not(:disabled):hover {
    background: #20BD5A;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--cinza-borda);
    color: var(--cinza-texto);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.btn-outline:hover {
    background: var(--cinza-borda);
}

/* ===== Conteúdo do relatório ===== */
.wrapper {
    width: 100%;
    max-width: 210mm;
    background: var(--white);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 40px;
    position: relative;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.col {
    flex: 1;
    min-width: 0;
}

.col-2 {
    flex: 2;
    min-width: 0;
}

.card {
    background: var(--white);
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    border-top: 4px solid var(--grafite);
    page-break-inside: avoid;
    break-inside: avoid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card.allow-break {
    page-break-inside: auto;
    break-inside: auto;
}

.section-title {
    color: var(--azul-escuro);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--cinza-claro);
    padding-bottom: 10px;
    text-transform: uppercase;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--azul-escuro);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

label.req::after {
    content: ' *';
    color: var(--danger);
}

input[type="text"],
input[type="date"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--cinza-borda);
    border-radius: 6px;
    font-size: 14px;
    color: var(--azul-escuro);
    background-color: #FAFAFA;
    transition: all 0.3s;
    outline: none;
}

textarea {
    resize: vertical;
    overflow: hidden;
    height: auto;
    min-height: 60px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--azul-institucional);
    box-shadow: 0 0 0 3px rgba(1, 70, 140, 0.1);
    background-color: var(--white);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger) !important;
    background-color: #FEF2F2 !important;
}

input.is-valid,
select.is-valid,
textarea.is-valid {
    border-color: var(--success) !important;
}

.error-msg {
    color: var(--danger);
    font-size: 10px;
    font-weight: 600;
    margin-top: -4px;
    display: none;
}

.is-invalid ~ .error-msg {
    display: block;
}

select.warning-border {
    border-color: var(--grafite) !important;
    border-width: 2px !important;
    background-color: #F3F4F6 !important;
    color: var(--grafite) !important;
}

.alerta-box {
    display: none;
    background: #F3F4F6;
    border-left: 4px solid var(--grafite);
    padding: 12px;
    margin-top: 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--grafite);
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
    font-weight: 500;
}

.pdf-warning {
    display: none;
    font-size: 11px;
    color: var(--danger);
    font-weight: bold;
    margin-top: 8px;
    padding: 8px;
    border: 1px dashed var(--danger);
    background: #FEF2F2;
    border-radius: 4px;
}

body.pdf-mode .alerta-box {
    display: none !important;
}

body.pdf-mode .pdf-warning.active-pdf-warning {
    display: block !important;
}

body:not(.pdf-mode) .pdf-only-classification {
    display: none !important;
}

body.pdf-mode .pdf-only-classification {
    display: block !important;
}

.smart-check-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .smart-check-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.smart-item {
    border: 1px solid var(--cinza-borda);
    border-radius: 6px;
    padding: 12px 16px;
    background: #FAFAFA;
    transition: all 0.3s;
    page-break-inside: avoid;
    break-inside: avoid;
}

.smart-item.approved {
    border-left: 4px solid var(--success);
    background: #F6FDF9;
    border-color: #D1FAE5;
}

.smart-item.reproved {
    border-left: 4px solid var(--danger);
    background: #FEF2F2;
    border-color: #FECACA;
}

.smart-item.is-invalid {
    border: 2px dashed var(--danger) !important;
    background-color: #FEF2F2;
}

.smart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
}

.smart-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--azul-escuro);
    flex: 1;
    line-height: 1.3;
}

.smart-switch {
    display: flex;
    background-color: #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    width: 120px;
    border: 1px solid #D1D5DB;
    flex-shrink: 0;
}

.smart-switch input[type="radio"] {
    display: none;
}

.smart-switch label {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 700;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin: 0;
    user-select: none;
}

.smart-switch input[value="SIM"]:checked+label {
    background-color: var(--success);
    color: white;
}

.smart-switch input[value="NAO"]:checked+label {
    background-color: var(--danger);
    color: white;
}

.smart-reason {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--danger) !important;
    border-radius: 4px;
    font-size: 12px;
    background: #FFF !important;
    min-height: 40px;
    resize: vertical;
    overflow: hidden;
    height: auto;
}

.smart-reason:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.sub-title {
    font-size: 15px;
    color: var(--azul-institucional);
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: 25px;
    border-bottom: 1px dashed var(--cinza-borda);
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.alert-badge {
    font-size: 10px;
    background: #FEF2F2;
    color: #DC2626;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #FECACA;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.mandatory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.mandatory-slot {
    aspect-ratio: 9/16;
    background: #F0F4F8;
    border: 2px dashed var(--azul-institucional);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.mandatory-slot.is-invalid {
    border-color: var(--danger);
    background-color: #FEF2F2;
}

.mandatory-slot.filled {
    border: 2px solid var(--grafite);
}

.slot-content-empty {
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    pointer-events: none;
}

.slot-icon {
    font-size: 24px;
    margin-bottom: 4px;
    color: var(--azul-institucional);
}

.slot-label {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    padding: 0 5px;
    color: var(--azul-escuro);
    line-height: 1.2;
}

.slot-desc {
    font-size: 10px;
    color: var(--danger);
    text-align: center;
    margin-top: 6px;
    font-weight: 500;
}

.mandatory-slot img {
    position: absolute;
    width: 100%;
    height: 60%;
    object-fit: cover;
    z-index: 1;
    display: none;
    top: 0;
    left: 0;
    background: #E5E7EB;
    border-radius: 8px 8px 0 0;
}

.slot-content-filled {
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40%;
    position: absolute;
    bottom: 0;
    left: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    border-top: 2px solid var(--success);
    pointer-events: none;
}

.mandatory-slot.filled .slot-content-empty {
    display: none;
}

.mandatory-slot.filled .slot-content-filled {
    display: flex;
}

.mandatory-slot.filled img {
    display: block;
}

.mandatory-slot .btn-delete {
    z-index: 10;
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 14px;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}

.mandatory-slot.filled .btn-delete {
    display: flex;
}

@media (max-width: 768px) {
    .mandatory-slot.filled .btn-delete {
        display: none !important;
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    align-items: flex-end;
    justify-content: center;
}

.modal-sheet {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    padding-bottom: 40px;
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

#photo-viewer-overlay {
    align-items: center;
    justify-content: center;
}

#photo-viewer-overlay .modal-sheet {
    transform: scale(0.9);
    opacity: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
}

#photo-viewer-overlay.active .modal-sheet {
    transform: scale(1);
    opacity: 1;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    border: none;
    background: #F3F4F6;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--azul-escuro);
    margin-bottom: 12px;
    cursor: pointer;
    justify-content: center;
    transition: all 0.2s;
}

.modal-btn:active {
    transform: scale(0.98);
}

.modal-btn:hover {
    background: #E5E7EB;
}

.modal-btn.danger {
    color: var(--danger);
    background: #FEF2F2;
}

.modal-btn.danger:hover {
    background: #FEE2E2;
}

.modal-btn.cancel {
    background: transparent;
    color: var(--cinza-texto);
    margin-top: 10px;
    font-size: 15px;
}

.warning-glow {
    animation: redGlow 2s infinite;
}

@keyframes redGlow {
    0% { box-shadow: 0 0 0px #DC2626; }
    50% { box-shadow: 0 0 15px #DC2626; }
    100% { box-shadow: 0 0 0px #DC2626; }
}

.upload-area {
    border: 2px dashed #9CA3AF;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    background: #F9FAFB;
    transition: all 0.3s;
    margin-bottom: 20px;
    cursor: pointer;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.preview-item {
    aspect-ratio: 9/16;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--cinza-borda);
    position: relative;
    background: #E5E7EB;
    cursor: grab;
    transition: transform 0.2s;
}

.preview-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.preview-item.drag-over {
    border: 2px dashed var(--grafite);
    opacity: 0.7;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .btn-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: var(--danger);
}

.declaration-box {
    background: #F0F9FF;
    border: 2px solid var(--azul-institucional);
    border-left: 6px solid var(--azul-institucional);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(1, 70, 140, 0.15);
}

.declaration-box label {
    display: flex;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--azul-escuro);
    text-transform: none;
    letter-spacing: normal;
}

.declaration-box input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--azul-institucional);
}

.signature-container {
    border: 2px solid var(--cinza-borda);
    border-radius: 8px;
    background: var(--white);
    overflow: hidden;
    position: relative;
}

.signature-container.is-invalid {
    border-color: var(--danger);
}

canvas.sig-pad {
    width: 100%;
    height: 160px;
    display: block;
    touch-action: none;
    cursor: crosshair;
}

.signature-footer {
    background: #FAFAFA;
    padding: 12px;
    border-top: 1px solid var(--cinza-borda);
    text-align: center;
    font-weight: 600;
    color: var(--azul-escuro);
    font-size: 14px;
}

.nome-assinatura {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    background: #F8FAFC !important;
}

.btn-expand-sig {
    width: 100%;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
    background: var(--azul-institucional);
    color: white;
    border: none;
    padding: 14px;
    box-shadow: 0 4px 6px rgba(1, 70, 140, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-expand-sig:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(1, 70, 140, 0.3);
}

.btn-expand-sig:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #9CA3AF;
    box-shadow: none;
    transform: none;
}

.btn-clear-sig {
    background-color: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    padding: 8px 16px;
    font-size: 12px;
    margin-top: 10px;
    width: 100%;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-sig:hover {
    background: #FEF2F2;
}

.signature-status {
    background: #E5E7EB;
    color: #4B5563;
    text-align: center;
    padding: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid var(--cinza-borda);
    transition: all 0.3s;
}

.signature-status.signed {
    background: var(--success);
    color: white;
}

.signature-container.locked {
    background-color: #F9FAFB;
    border-color: var(--success);
}

.signature-container.locked canvas {
    pointer-events: none;
    cursor: default;
}

/* ===== Modal de assinatura em tela cheia ===== */
#fs-sig-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    padding: 8px;
}

#fs-sig-wrapper {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
    height: 100%;
    max-width: 700px;
    max-height: 900px;
    box-sizing: border-box;
    gap: 6px;
    transform-origin: center;
    transition: transform 0.2s ease;
    position: relative;
}

#fs-sig-wrapper .fs-title {
    font-weight: 700;
    color: var(--azul-escuro);
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
    padding: 4px 0;
    border-bottom: 1px solid var(--cinza-borda);
}

#fs-sig-canvas {
    flex: 1;
    width: 100%;
    min-height: 150px;
    background: var(--white);
    border-radius: 8px;
    border: 2px dashed var(--azul-institucional);
    touch-action: none;
    display: block;
}

.fs-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    justify-content: center;
    padding: 4px 0;
    flex-wrap: wrap;
}

.fs-actions button {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    flex: 1;
    min-width: 70px;
    max-width: 140px;
    transition: background 0.2s;
}

.fs-actions .btn-clear-sig {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
}

.fs-actions .btn-clear-sig:hover {
    background: #FEF2F2;
}

.fs-actions .btn-outline {
    background: transparent;
    border: 2px solid var(--cinza-borda);
    color: var(--cinza-texto);
}

.fs-actions .btn-outline:hover {
    background: var(--cinza-borda);
}

.fs-actions .btn-primary {
    background: var(--azul-institucional);
    color: white;
}

.fs-actions .btn-primary:hover {
    background: var(--azul-escuro);
}

.qr-validation {
    display: none;
    padding: 15px;
    border: 1px dashed var(--cinza-borda);
    border-radius: 8px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: #FFF;
}

.qr-validation p {
    font-size: 9px;
    color: var(--cinza-texto);
    line-height: 1.3;
}

.qr-validation strong {
    color: var(--azul-escuro);
    font-size: 11px;
}

/* ===== Modo PDF ===== */
body.pdf-mode .control-panel {
    display: none !important;
}

body.pdf-mode #draft-banner {
    display: none !important;
}

body.pdf-mode .wrapper {
    width: 190mm !important;
    max-width: 190mm !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

body.pdf-mode .col {
    flex: 1 !important;
}

body.pdf-mode .col-2 {
    flex: 2 !important;
}

body.pdf-mode .upload-area,
body.pdf-mode .btn,
body.pdf-mode .action-bar,
body.pdf-mode .btn-delete,
body.pdf-mode .alert-badge,
body.pdf-mode .btn-expand-sig,
body.pdf-mode .btn-clear-sig,
body.pdf-mode .signature-status {
    display: none !important;
}

body.pdf-mode input,
body.pdf-mode textarea,
body.pdf-mode select {
    border: none;
    border-bottom: 1px dashed #CCC;
    background: transparent;
    padding: 5px 0;
    border-radius: 0;
}

body.pdf-mode .card {
    border: none;
    box-shadow: none;
    border-top: 2px solid var(--grafite);
    padding: 10px 0;
    margin-bottom: 15px;
}

body.pdf-mode .declaration-box {
    border: none;
    border-left: 4px solid var(--azul-institucional);
    background: transparent;
    box-shadow: none;
    padding: 10px;
}

body.pdf-mode .qr-validation {
    display: flex !important;
}

body.pdf-mode .nome-assinatura {
    border: none !important;
    border-bottom: 1px dashed #000 !important;
    font-weight: bold !important;
    font-size: 14px !important;
    color: #000 !important;
    margin-top: 5px !important;
}

body.pdf-mode .error-msg {
    display: none !important;
}

body.pdf-mode .smart-item {
    border: none !important;
    border-bottom: 1px solid var(--cinza-borda) !important;
    border-radius: 0 !important;
    padding: 6px 0 !important;
    background: transparent !important;
}

body.pdf-mode .smart-item.reproved {
    border-left: none !important;
    background: rgba(254, 226, 226, 0.4) !important;
}

body.pdf-mode .smart-reason {
    border: none !important;
    border-bottom: 1px dashed var(--danger) !important;
    background: transparent !important;
    padding: 4px 0 !important;
    margin-top: 4px !important;
}

body.pdf-mode #video-preview-container {
    display: none !important;
}

.no-break {
    page-break-inside: avoid;
    break-inside: avoid;
}

body.pdf-mode .smart-switch {
    background: transparent !important;
    border: none !important;
    width: auto !important;
    box-shadow: none !important;
}

body.pdf-mode .smart-switch label {
    padding: 0 !important;
    font-size: 13px !important;
}

body.pdf-mode .smart-switch input[type="radio"]:not(:checked)+label {
    display: none !important;
}

body.pdf-mode .smart-switch input[value="SIM"]:checked+label {
    color: var(--success) !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.pdf-mode .smart-switch input[value="NAO"]:checked+label {
    color: var(--danger) !important;
    background: transparent !important;
    box-shadow: none !important;
}

#pdf-strict-gallery {
    width: 100%;
    margin-top: 20px;
}

.pdf-photo-item {
    display: inline-block;
    width: 55mm;
    margin: 2mm 1.5mm;
    vertical-align: top;
    page-break-inside: avoid;
    break-inside: avoid;
}

/* ===== OVERLAY DE ENVIO ===== */
.send-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    background-color: var(--azul-institucional);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.4s ease, background-color 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.send-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.send-overlay.success {
    background-color: var(--success);
}

.send-overlay.error {
    background-color: var(--danger);
}

.send-content {
    text-align: center;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.send-logo {
    max-width: 220px;
    margin-bottom: 25px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    background: white;
    padding: 12px;
    border-radius: 8px;
}

.send-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.send-os {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 600;
    margin-bottom: 30px;
    background: rgba(0,0,0,0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.send-percentage {
    font-size: 54px;
    font-weight: 900;
    margin-bottom: 10px;
    line-height: 1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.send-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.send-progress-fill {
    height: 100%;
    width: 0%;
    background: white;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.send-status {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 10px;
}

.send-icon {
    font-size: 70px;
    margin-bottom: 15px;
    line-height: 1;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== BANNER AMARELO PÓS-ENVIO ===== */
.post-success-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #FEF3C7;
    border-bottom: 4px solid var(--warning);
    padding: 20px;
    z-index: 100005;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
}

.post-success-banner.active {
    display: flex;
    animation: slideDownBanner 0.4s ease-out forwards;
}

@keyframes slideDownBanner {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.banner-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.banner-icon {
    font-size: 26px;
    color: #D97706;
    line-height: 1;
}

.banner-text {
    color: #92400E;
    font-size: 13px;
    line-height: 1.5;
}

.banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: 41px;
}

.banner-actions button {
    flex: 1;
    min-width: 120px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-banner-download {
    background: var(--warning);
    color: white;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.btn-banner-download:hover {
    background: #D97706;
    transform: translateY(-2px);
}

.btn-banner-close {
    background: transparent;
    border: 2px solid #FCD34D;
    color: #B45309;
}

.btn-banner-close:hover {
    background: #FDE68A;
}

/* ===== RODAPÉ FIXO (mobile) ===== */
#footer-actions {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px 16px;
    background: var(--white);
    border-top: 2px solid var(--cinza-borda);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10002;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

.footer-row {
    display: flex;
    gap: 10px;
}

.footer-row .btn-footer {
    flex: 1;
    padding: 14px 8px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
    color: white;
    text-align: center;
    min-height: 50px;
}

.btn-footer:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pdf {
    background: var(--azul-institucional);
}

.btn-pdf:not(:disabled):hover {
    background: #013770;
}

.btn-wa {
    background: #25D366;
}

.btn-wa:not(:disabled):hover {
    background: #20BD5A;
}

.btn-enviar {
    background: var(--grafite);
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

.btn-enviar:not(:disabled):hover {
    background: #333333;
}

/* ===== Responsividade ===== */
@media (max-width: 768px) {
    body {
        padding-top: 140px;
        padding-bottom: 140px;
    }
    body:not(.pdf-mode) .wrapper {
        padding: 15px;
        border-radius: 0;
    }
    body:not(.pdf-mode) .col,
    body:not(.pdf-mode) .col-2 {
        flex: 0 0 100%;
    }
    .panel-actions {
        display: none;
    }
    .control-panel {
        padding: 10px 15px;
        gap: 8px;
    }
    .panel-os {
        font-size: 14px;
    }
    #footer-actions {
        display: flex;
    }
    #fs-sig-overlay {
        padding: 4px;
    }
    #fs-sig-wrapper {
        width: 98vw !important;
        height: 96vh !important;
        max-width: none;
        max-height: none;
        border-radius: 8px;
        padding: 8px;
        gap: 4px;
    }
    #fs-sig-wrapper .fs-title {
        font-size: 14px;
        padding: 2px 0;
    }
    .fs-actions button {
        padding: 12px 8px;
        font-size: 16px;
        min-width: 60px;
        flex: 1;
        max-width: none;
        height: 48px;
    }
    .fs-actions {
        gap: 6px;
    }
}

/* ===== ESTILOS PARA PARTICIPANTES ===== */
.participante-block {
    background: #F9FAFB;
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.participante-block:first-child {
    border-color: var(--azul-institucional);
}

.participante-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--azul-escuro);
    font-size: 14px;
}

.participante-header .btn-remove-participante {
    background: transparent;
    border: none;
    color: var(--danger);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.participante-header .btn-remove-participante:hover {
    background: #FEF2F2;
}

.participante-block .row {
    margin-bottom: 8px;
}

.participante-block .row:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .participante-block .col {
        flex: 0 0 100%;
    }
}

#btn-add-participante {
    margin-top: 10px;
    border-color: var(--azul-institucional);
    color: var(--azul-institucional);
    padding: 10px 20px;
    font-weight: 600;
}

#btn-add-participante:hover {
    background: var(--azul-institucional);
    color: white;
}

.participante-error {
    color: var(--danger);
    font-size: 12px;
    display: none;
    margin-top: 10px;
    padding: 8px 12px;
    background: #FEF2F2;
    border-radius: 6px;
    border: 1px solid #FECACA;
}

.participante-block .campo-pendente {
    border-color: var(--danger) !important;
    background: #FEF2F2 !important;
}

.participante-block .campo-pendente~.error-msg {
    display: block;
}