/* =========================================================================
   MODAL DE SEPARAÇÃO E DESPACHO - POINT TELECOM PREMIUM
   Arquivo: frontend/css/separation-modal.css
   ========================================================================= */

/* -------------------------------------------------------------------------
   HEADER ESCURO COM FLOW 1-2-3
   ------------------------------------------------------------------------- */
.separation-modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    padding: 20px 28px !important;
    border-bottom: 3px solid var(--point-orange, #fd7e14) !important;
    color: #fff !important;
    display: block !important;
    position: relative;
    overflow: hidden;
}
.separation-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(253, 126, 20, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* Título */
.separation-header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    position: relative;
    z-index: 2;
}
.separation-header-title .title-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.separation-header-title .title-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--point-orange, #fd7e14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 6px 16px rgba(253, 126, 20, 0.4);
    flex-shrink: 0;
}
.separation-header-title h5 {
    margin: 0;
    font-weight: 900;
    letter-spacing: -0.3px;
    font-size: 1.15rem;
    color: #fff;
}
.separation-header-title small {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* -------------------------------------------------------------------------
   FLOW 1-2-3 (Step indicator)
   ------------------------------------------------------------------------- */
.separation-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
}
.separation-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.separation-step .step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.separation-step .step-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.separation-step .step-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}
.separation-step .step-status {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}
.separation-step .step-arrow {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
    margin: 0 8px;
    flex-shrink: 0;
}

/* Estado: CONCLUÍDO */
.separation-step.is-done .step-num {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}
.separation-step.is-done .step-label,
.separation-step.is-done .step-status {
    color: #10b981;
}

/* Estado: ATIVO */
.separation-step.is-active .step-num {
    background: var(--point-orange, #fd7e14);
    border-color: var(--point-orange, #fd7e14);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(253, 126, 20, 0.25);
    animation: pulse-step 1.8s ease-in-out infinite;
}
.separation-step.is-active .step-label,
.separation-step.is-active .step-status {
    color: #fff;
}

@keyframes pulse-step {
    0%, 100% { box-shadow: 0 0 0 4px rgba(253, 126, 20, 0.25); }
    50%      { box-shadow: 0 0 0 8px rgba(253, 126, 20, 0.1); }
}

/* -------------------------------------------------------------------------
   CARDS DAS 3 COLUNAS
   ------------------------------------------------------------------------- */
.separation-column {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.separation-column:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.separation-column-header {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.separation-column-header i {
    margin-right: 6px;
    font-size: 0.85rem;
}
.separation-column-header.col-blue   { background: #eff6ff; color: #1d4ed8; border-bottom-color: #bfdbfe; }
.separation-column-header.col-green  { background: #f0fdf4; color: #15803d; border-bottom-color: #bbf7d0; }
.separation-column-header.col-orange { background: #fff7ed; color: #c2410c; border-bottom-color: #fed7aa; }

.separation-column-body {
    padding: 16px 18px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* -------------------------------------------------------------------------
   SCANNER ZONE (coluna 2)
   ------------------------------------------------------------------------- */
.separation-scanner-zone {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 12px;
}
.separation-scanner-zone:focus-within {
    border-color: #10b981;
    border-style: solid;
    background: #f0fdf4;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}
.separation-scanner-zone textarea {
    border: none;
    background: transparent;
    resize: none;
    width: 100%;
    min-height: 70px;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.5;
}
.separation-scanner-zone .scanner-counter {
    position: absolute;
    top: 8px;
    right: 10px;
    background: #10b981;
    color: #fff;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

/* -------------------------------------------------------------------------
   PROGRESSO DE BIPAGEM
   ------------------------------------------------------------------------- */
.separation-progress-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.separation-progress-box .progress-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.separation-progress-box .progress-info strong {
    color: #15803d;
    font-size: 0.85rem;
    font-weight: 900;
}
.separation-progress-box .progress-info small {
    color: #4ade80;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.separation-progress-box .progress-bar-mini {
    flex: 1;
    max-width: 120px;
    height: 8px;
    background: #dcfce7;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}
.separation-progress-box .progress-bar-mini .fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 50px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* -------------------------------------------------------------------------
   LISTA DE SERIAIS BIPADOS
   ------------------------------------------------------------------------- */
.separation-serial-list {
    flex: 1;
    min-height: 150px;
    overflow-y: auto;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px;
}

/* -------------------------------------------------------------------------
   BOTÃO FINAL "CONCLUIR DESPACHO" (dinâmico)
   ------------------------------------------------------------------------- */
.separation-dispatch-btn {
    background: #cbd5e1 !important;
    border: none !important;
    color: #64748b !important;
    font-weight: 900 !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    letter-spacing: 0.5px;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    cursor: not-allowed;
    width: 100%;
}
.separation-dispatch-btn.is-ready {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    cursor: pointer;
    animation: pulse-dispatch 1.8s ease-in-out infinite;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}
.separation-dispatch-btn.is-ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(16, 185, 129, 0.5);
}

@keyframes pulse-dispatch {
    0%, 100% { box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4); }
    50%      { box-shadow: 0 8px 26px rgba(16, 185, 129, 0.65); }
}

/* -------------------------------------------------------------------------
   RODAPÉ DO MODAL (se usar)
   ------------------------------------------------------------------------- */
.separation-modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 14px 20px;
}

/* =========================================================================
   CORREÇÃO DO FLOW 1-2-3 (evitar sobreposição)
   ========================================================================= */
.separation-flow {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.separation-flow .separation-step {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto !important;
    min-width: 0;
}

.separation-flow .step-arrow {
    flex-shrink: 0 !important;
    margin: 0 6px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
    pointer-events: none;
}

.separation-flow .step-info {
    min-width: 0;
    overflow: hidden;
}

.separation-flow .step-label,
.separation-flow .step-status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ============================================================
   BARRA DE PROGRESSO GERAL (topo, abaixo do flow 1-2-3)
   ============================================================ */
.separation-global-progress {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.separation-global-progress .progress-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.separation-global-progress .progress-bar-big {
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}
.separation-global-progress .progress-bar-big .fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 50px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    width: 0%;
}
.separation-global-progress .progress-count {
    font-size: 0.85rem;
    font-weight: 900;
    color: #fff;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 4px 12px;
    border-radius: 50px;
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
}

/* ============================================================
   CARDS DE ITEM DA COLUNA 1 (Roteiro de Coleta)
   ============================================================ */
.roteiro-item-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.roteiro-item-card .item-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.roteiro-item-card .item-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    transition: all 0.3s ease;
}
.roteiro-item-card .item-check i {
    color: #fff;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.roteiro-item-card .item-info {
    flex: 1;
    min-width: 0;
}
.roteiro-item-card .item-name {
    font-weight: 800;
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.2;
    word-break: break-word;
}
.roteiro-item-card .item-loc {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-top: 2px;
}
.roteiro-item-card .item-qty-badge {
    font-size: 0.68rem;
    font-weight: 900;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}
.roteiro-item-card .item-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748b;
}
.roteiro-item-card .item-progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 50px;
    overflow: hidden;
    margin-top: 4px;
}
.roteiro-item-card .item-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 50px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* Estado: PARCIAL */
.roteiro-item-card.is-partial {
    border-color: #3b82f6;
    background: #eff6ff;
}
.roteiro-item-card.is-partial .item-check {
    border-color: #3b82f6;
    background: #3b82f6;
}
.roteiro-item-card.is-partial .item-check i { opacity: 1; }
.roteiro-item-card.is-partial .item-progress-bar .fill {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

/* Estado: COMPLETO */
.roteiro-item-card.is-complete {
    border-color: #10b981;
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.roteiro-item-card.is-complete .item-check {
    border-color: #10b981;
    background: #10b981;
    animation: pop-check 0.4s ease;
}
.roteiro-item-card.is-complete .item-check i { opacity: 1; }
.roteiro-item-card.is-complete .item-progress-bar .fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

@keyframes pop-check {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Flash ao bipar */
.roteiro-item-card.flash-success {
    animation: flash-green 0.6s ease;
}
@keyframes flash-green {
    0%   { background: #10b981; border-color: #059669; }
    100% { background: #f0fdf4; border-color: #10b981; }
}

.roteiro-item-card.flash-error {
    animation: shake-red 0.5s ease;
}
@keyframes shake-red {
    0%, 100% { transform: translateX(0); background: #fef2f2; }
    25%      { transform: translateX(-4px); background: #fee2e2; }
    75%      { transform: translateX(4px); background: #fee2e2; }
}

/* ============================================================
   CARDS DE SERIAL BIPADO (Coluna 2)
   ============================================================ */
.bipado-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #10b981;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    animation: slide-in-bipado 0.3s ease;
}
@keyframes slide-in-bipado {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.bipado-card .bip-info {
    min-width: 0;
}
.bipado-card .bip-serial {
    font-family: 'Courier New', monospace;
    font-weight: 800;
    color: #1e293b;
    font-size: 0.8rem;
}
.bipado-card .bip-modelo {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 700;
    margin-top: 1px;
}
.bipado-card .bip-remove {
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px 8px;
    background: none;
    border: none;
}
.bipado-card .bip-remove:hover {
    color: #ef4444;
}

/* =========================================================================
   WIZARD 3 ETAPAS - SEPARAÇÃO E DESPACHO
   ========================================================================= */

/* -------------------------------------------------------------------------
   TABS DE ETAPA (substitui o flow 1-2-3 simples)
   ------------------------------------------------------------------------- */
.separation-steps-nav {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px;
    margin-top: 12px;
}

.separation-step-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.separation-step-tab:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
}

.separation-step-tab.is-active {
    background: var(--point-orange, #fd7e14);
    color: #fff;
    box-shadow: 0 6px 16px rgba(253, 126, 20, 0.4);
}

.separation-step-tab.is-complete {
    color: #10b981;
}
.separation-step-tab.is-complete .step-tab-num {
    background: #10b981;
    color: #fff;
}

.separation-step-tab .step-tab-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    flex-shrink: 0;
}

.separation-step-tab.is-active .step-tab-num {
    background: rgba(255, 255, 255, 0.25);
}

/* -------------------------------------------------------------------------
   ÁREA DE CONTEÚDO DINÂMICO (muda conforme a etapa)
   ------------------------------------------------------------------------- */
.separation-content-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.separation-etapa-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    overflow-y: auto;
    padding: 4px;
}
.separation-etapa-panel.is-active {
    display: flex;
    animation: etapaFadeIn 0.3s ease;
}
@keyframes etapaFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   CANVAS DE ASSINATURA (Etapa 3)
   ------------------------------------------------------------------------- */
.signature-wrapper {
    background: #fff;
    border: 2px dashed #c4b5fd;
    border-radius: 16px;
    padding: 8px;
    position: relative;
    transition: all 0.2s ease;
}
.signature-wrapper:focus-within {
    border-color: #7c3aed;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}
.signature-inner {
    background: #fafbfc;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
#separationSignaturePad {
    width: 100%;
    height: 180px;
    touch-action: none;
    cursor: crosshair;
    display: block;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
}
.signature-label {
    position: absolute;
    bottom: 10px;
    left: 14px;
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}
.signature-clear-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 5px 12px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #dc2626;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    z-index: 2;
    cursor: pointer;
}
.signature-clear-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* -------------------------------------------------------------------------
   CHECKBOX "CONFIRMO..." (Etapa 3)
   ------------------------------------------------------------------------- */
.signature-confirm-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fcd34d;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}
.signature-confirm-box:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}
.signature-confirm-box input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}
.signature-confirm-box .confirm-text {
    font-size: 0.85rem;
    color: #78350f;
    font-weight: 600;
    line-height: 1.5;
}
.signature-confirm-box .confirm-text strong {
    color: #7c3aed;
}

/* -------------------------------------------------------------------------
   BOTÃO "CONCLUIR DESPACHO" NA ETAPA 3
   ------------------------------------------------------------------------- */
.separation-dispatch-btn {
    background: #cbd5e1 !important;
    border: none !important;
    color: #64748b !important;
    font-weight: 900 !important;
    padding: 16px 24px !important;
    border-radius: 12px !important;
    letter-spacing: 0.5px;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    cursor: not-allowed;
    width: 100%;
}
.separation-dispatch-btn.is-ready {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    cursor: pointer;
    animation: pulseDispatch 1.8s ease-in-out infinite;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}
.separation-dispatch-btn.is-ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(16, 185, 129, 0.5);
}
@keyframes pulseDispatch {
    0%, 100% { box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4); }
    50%      { box-shadow: 0 8px 26px rgba(16, 185, 129, 0.65); }
}

/* -------------------------------------------------------------------------
   RESPONSIVO
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .separation-step-tab {
        padding: 10px 8px;
        font-size: 0.65rem;
    }
    .separation-step-tab .step-tab-label {
        display: none;
    }
    #separationSignaturePad {
        height: 150px;
    }
}

/* =========================================================================
   WIZARD 3 ETAPAS — CLASSES USADAS PELO HTML DA MODAL
   ========================================================================= */

/* Tabs do wizard (usadas no HTML da openSeparationModal) */
.separation-wizard-tabs {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px;
    margin-top: 12px;
    margin-bottom: 14px;
}
.separation-wizard-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 800;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}
.separation-wizard-tab:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
}
.separation-wizard-tab.is-active {
    background: var(--point-orange, #fd7e14);
    color: #fff;
    box-shadow: 0 6px 16px rgba(253, 126, 20, 0.4);
}
.separation-wizard-tab.is-complete {
    color: #10b981;
}
.separation-wizard-tab .wizard-tab-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 900;
    flex-shrink: 0;
}
.separation-wizard-tab.is-active .wizard-tab-num {
    background: rgba(255, 255, 255, 0.25);
}
.separation-wizard-tab.is-complete .wizard-tab-num {
    background: #10b981;
    color: #fff;
}

/* Painéis do wizard */
.separation-wizard-panel {
    display: none;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-height: 0;
}
.separation-wizard-panel.is-active {
    display: flex;
    animation: wizardFadeIn 0.3s ease;
}
@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Botões de navegação entre etapas */
.separation-wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}
.separation-wizard-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.separation-wizard-btn.prev {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}
.separation-wizard-btn.prev:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.separation-wizard-btn.next {
    background: linear-gradient(135deg, #fd7e14 0%, #ea580c 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(253, 126, 20, 0.35);
    margin-left: auto;
}
.separation-wizard-btn.next:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(253, 126, 20, 0.45);
}
.separation-wizard-btn:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

/* Compactação do modal wizard */
#separationModal .modal-body {
    padding: 0 !important;
}
#separationModal .row.h-100 {
    min-height: auto;
    max-height: calc(100vh - 200px);
}
#separationModal .col-md-3,
#separationModal .col-md-9 {
    max-height: calc(100vh - 200px);
}
#separationModal .separation-column {
    max-height: 100%;
}

/* =========================================================================
   CARDS DE MODELO AGRUPADOS (Coluna 2 — seriais bipados)
   ========================================================================= */

.modelo-group-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.modelo-group-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

/* Header do card (clicável pra expandir) */
.modelo-group-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}
.modelo-group-header:hover {
    background: #f8fafc;
}

/* Ícone/foto do modelo */
.modelo-group-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.modelo-group-icon img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
.modelo-group-icon i {
    font-size: 1.4rem;
    color: #94a3b8;
}

/* Info do modelo (nome + progresso) */
.modelo-group-info {
    flex: 1;
    min-width: 0;
}
.modelo-group-name {
    font-weight: 900;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: -0.2px;
    margin-bottom: 6px;
}
.modelo-group-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 4px;
}
.modelo-group-progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 50px;
    overflow: hidden;
}
.modelo-group-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 50px;
    transition: width 0.4s ease;
}
.modelo-group-card.is-complete .modelo-group-progress-bar .fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* Seta do expansor */
.modelo-group-arrow {
    color: #94a3b8;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.modelo-group-card.is-expanded .modelo-group-arrow {
    transform: rotate(180deg);
}

/* Lista de seriais (escondida por padrão) */
.modelo-group-serials {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafbfc;
    border-top: 1px solid #f1f5f9;
}
.modelo-group-card.is-expanded .modelo-group-serials {
    max-height: 400px;
    overflow-y: auto;
}
.modelo-group-serials-list {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Chip individual de serial */
.serial-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    transition: all 0.2s ease;
}
.serial-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.serial-chip code {
    font-family: 'Courier New', monospace;
    font-weight: 800;
    color: #0f172a;
    font-size: 0.8rem;
}
.serial-chip .chip-remove {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.2s ease;
    font-size: 0.85rem;
}
.serial-chip .chip-remove:hover {
    color: #ef4444;
}

/* Estado vazio */
.serial-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}
.serial-empty-state i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 12px;
}
.serial-empty-state p {
    font-size: 0.85rem;
    margin: 0;
}

/* =========================================================================
   CANVAS DE ASSINATURA — MAIS ESPAÇO PARA NOMES LONGOS
   ========================================================================= */

/* Aumentar altura do canvas (tanto recebimento quanto separação) */
#recebimentoSignaturePad,
#separationSignaturePad {
    width: 100% !important;
    height: 220px !important;    /* ← Aumentado de 180 pra 220 */
    display: block;
    touch-action: none;
    cursor: crosshair;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
}

/* Wrapper com respiro maior */
.signature-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    box-sizing: border-box;
    background: #fff;
    border: 2px dashed #c4b5fd;
    border-radius: 16px;
    position: relative;
    transition: all 0.2s ease;
}

.signature-wrapper:focus-within {
    border-color: #7c3aed;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.signature-inner {
    width: 100%;
    background: #fafbfc;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 220px;
}

/* Aviso quando o canvas é pequeno */
@media (max-width: 576px) {
    #recebimentoSignaturePad,
    #separationSignaturePad {
        height: 260px !important;   /* ← Mobile precisa de mais ainda */
    }
}