/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (BLING ERP THEMING)
   ========================================================================== */
:root {
    /* Cores do Tema Light (Padrão Bling ERP) */
    --bg-app: #f4f6f9;               /* Cinza claro para fundo */
    --bg-panel: #ffffff;             /* Branco para os painéis */
    --bg-card: #ffffff;              /* Branco para os cards */
    --bg-card-hover: #f8fafc;        /* Hover suave azul-cinza */
    --border-color: #e2e8f0;         /* Cinza claro para divisórias */
    --text-primary: #1e293b;         /* Slate escuro para textos */
    --text-secondary: #64748b;       /* Slate médio para descrições */
    --text-highlight: #00ad5c;       /* Verde Bling para marcas/destaques */
    
    --primary: #00ad5c;              /* Verde Bling para botões principais */
    --primary-hover: #009650;
    --secondary: #f39200;            /* Laranja Bling para alertas/pendências */
    --secondary-hover: #db8000;
    
    --success: #00ad5c;
    --success-bg: #e6f7f0;
    --warning: #f39200;
    --warning-bg: #fef3e6;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    
    --header-bg: #747474;            /* Cinza Uze Nails para o topo */
    
    --shadow-main: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02), 0 10px 15px -3px rgba(0,0,0,0.04);
    
    /* Configurações padrão de Impressão (em mm/px, ajustadas por JS) */
    --print-width: 100mm;
    --print-height: 150mm;
    --print-margin: 4mm;
    --barcode-height: 45px;
    --font-size-label: 10px;
}

/* Tema Escuro Alternativo (Bling Dark Mode) */
.light-theme {
    /* Bling Dark Mode Customization */
    --bg-app: #111827;
    --bg-panel: #1f2937;
    --bg-card: #1f2937;
    --bg-card-hover: #374151;
    --border-color: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --header-bg: #111827;
    --shadow-main: 0 10px 15px -3px rgba(0,0,0,0.3);
    
    /* Cores de status ajustadas para o Modo Escuro */
    --success-bg: #064e3b;      /* Verde escuro para fundo de sucesso */
    --warning-bg: #451a03;      /* Laranja/Amber escuro para fundo de aviso */
    --danger-bg: #450a0a;       /* Vermelho escuro para fundo de perigo */
}

/* Customizações e Contrastes do Modo Escuro */
.light-theme .badge-checking {
    background-color: #4b5563;
    color: #f3f4f6;
    border-color: rgba(243, 244, 246, 0.2);
}

.light-theme .badge-checked {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
}

.light-theme .text-checked {
    color: #34d399;
}

.light-theme .text-pending {
    color: #fbbf24;
}

.light-theme .queue-item.active .queue-qty {
    color: #cbd5e1;
}


/* ==========================================================================
   RESET & CONFIGURAÇÕES GERAIS
   ========================================================================== */
.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-y: auto; /* Rolagem geral permitida no desktop */
    transition: background-color 0.3s, color 0.3s;
}

/* Container do App */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Scrollbars customizadas estilo Bling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.light-theme ::-webkit-scrollbar-thumb {
    background: #4b5563;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   CONTROLE DE ETAPAS (TABS/TELA INTEIRA)
   ========================================================================== */
.screen-view {
    display: none;
    width: 100%;
    height: 100%;
}

#app-container.step-1 #screen-entry {
    display: flex;
}
#app-container.step-2 #screen-expedition {
    display: flex;
    flex-direction: column;
}
#app-container.step-extrato-avulso #screen-extrato-avulso {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-app);
    padding: 1.5rem;
    height: 100vh;
}
#app-container.step-extrato-conferencia #screen-extrato-conferencia {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-app);
}
#app-container.step-login #screen-login {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-app);
    padding: 1.5rem;
    height: 100vh;
}



/* ==========================================================================
   ETAPA I: ENTRADA DE PEDIDOS (SCREEN-ENTRY)
   ========================================================================== */
#screen-entry {
    align-items: center;
    justify-content: center;
    background-color: var(--bg-app);
    padding: 1.5rem;
}

.entry-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.entry-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.entry-logo-img {
    height: 44px;
    object-fit: contain;
}

.light-theme .entry-logo-img {
    filter: brightness(0) invert(1);
}

.entry-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0;
}

.entry-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.entry-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.entry-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.entry-form-group textarea {
    min-height: 120px;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: none;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}
.light-theme .entry-form-group textarea {
    border-color: var(--border-color);
}

.entry-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    height: 52px;
}

.demo-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.demo-checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.demo-checkbox-wrapper label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* ==========================================================================
   ETAPA II: HEADER & CONTROLES
   ========================================================================== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: var(--header-bg);
    height: 64px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.btn-back {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    height: 38px;
    padding: 0 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.btn-back svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.header-logo-img {
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.header-logo h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #ffffff;
}

.logo-sub {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
}

/* Métricas no Cabeçalho */
.header-stats {
    display: flex;
    gap: 0.75rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Botões do Cabeçalho */
.header-controls {
    display: flex;
    gap: 0.4rem;
}

.header-controls .control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.header-controls .control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: none;
}

/* ==========================================================================
   PAINEL CARDS COMUNS & ELEMENTOS
   ========================================================================== */
.panel-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.2rem;
    box-shadow: var(--shadow-main);
}

h2, h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

h3 {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
}

/* Botões Customizados */
.btn-primary, .btn-secondary, .control-btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.2rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 173, 92, 0.2);
}

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.7rem 1.2rem;
}
.light-theme .btn-secondary {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.btn-secondary:hover {
    background: #e2e8f0;
}
.light-theme .btn-secondary:hover {
    background: #4b5563;
}

.control-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 6px;
}

.control-btn:hover {
    background: var(--bg-card-hover);
    transform: none;
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

/* Form Inputs */
textarea, select, input[type="text"], input[type="number"] {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.light-theme textarea, .light-theme select, .light-theme input {
    background: #111827;
    border-color: #4b5563;
}

textarea:focus, select:focus, input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 173, 92, 0.15);
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (COLUNA ÚNICA - TABLET OPTIMIZED)
   ========================================================================== */
.app-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    height: auto; /* Permite crescimento de conteúdo no desktop */
    min-height: calc(100vh - 64px);
    overflow: visible; /* Garante que a rolagem aconteça no body */
    box-sizing: border-box;
}

/* FILA DE PEDIDOS (topo, largura total) */
.orders-queue-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    height: 75px;
    padding: 0.5rem 1rem !important;
    overflow: hidden;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.orders-queue-panel h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 0;
    white-space: nowrap;
}

.queue-list-container {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 2px;
    align-items: center;
}

.queue-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 170px;
    height: 44px;
    flex-shrink: 0;
}

.queue-item:hover {
    background: var(--bg-card-hover);
    border-color: #cbd5e1;
}

.queue-item.active {
    border-color: var(--primary);
    background: var(--success-bg);
}

.queue-item-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
}

.queue-number {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.queue-qty {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.queue-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-pending { background-color: var(--secondary); box-shadow: 0 0 6px var(--secondary); }
.status-dot-checking { background-color: #878787; box-shadow: 0 0 6px #878787; }
.status-dot-checked { background-color: var(--primary); box-shadow: 0 0 6px var(--primary); }

/* LINHA PRINCIPAL: BIPAGEM (3/4) + LOG (1/4) */
.checkout-row {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    height: calc(100vh - 190px); /* Otimizado para ocupar o espaço vertical disponível após ocultar as etiquetas */
    min-height: 550px;
    flex-shrink: 0;
}

/* CONTAINER DE CONFERÊNCIA (bipagem) - 3/4 */
.checkout-panel-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 3;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* Painel de Scanner */
.scan-bar-container {
    padding: 0.8rem 1rem;
    flex-shrink: 0;
}

.scan-input-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.15rem 0.4rem;
}
.light-theme .scan-input-wrapper {
    background: #111827;
    border-color: #4b5563;
}

.icon-barcode {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
    margin-left: 0.4rem;
}

.scan-qty-input {
    width: 60px !important;
    height: 32px !important;
    padding: 2px 4px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    background-color: var(--bg-app) !important;
    color: var(--text-primary) !important;
    margin-left: 0.4rem !important;
    flex-shrink: 0 !important;
}
.light-theme .scan-qty-input {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
}
.scan-qty-multiplier {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0.3rem;
    user-select: none;
}

.scan-input-wrapper input {
    border: none !important;
    background: transparent !important;
    padding: 0.55rem;
    font-size: 0.95rem;
    box-shadow: none !important;
}

.scan-input-wrapper button {
    height: 34px;
    padding: 0 1rem;
    font-size: 0.85rem;
}

.scan-status-message {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding-left: 0.4rem;
    margin-top: 4px;
}

.scan-success { color: var(--primary); }
.scan-error { color: var(--danger); }

/* Painel de Itens Conferência */
.order-details-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.6rem;
    margin-bottom: 0.8rem;
    flex-shrink: 0;
}

.details-header h3 {
    font-size: 1.1rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending { background-color: var(--warning-bg); color: var(--warning); border: 1px solid rgba(243, 146, 0, 0.2); }
.badge-checking { background-color: #f3f4f6; color: #585858; border: 1px solid rgba(88, 88, 88, 0.2); }
.badge-checked { background-color: var(--success-bg); color: var(--primary); border: 1px solid rgba(0, 173, 92, 0.2); }

.order-items-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-right: 4px;
}

/* Cards de Itens Conferência (Touch Friendly, compactos p/ exibir ~7 por vez) */
.product-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    min-height: 54px; /* Touch target */
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.product-item-card:hover {
    border-color: #cbd5e1;
    background-color: var(--bg-card-hover);
}

.product-item-card.item-conferido {
    border-color: var(--primary);
    background: var(--success-bg);
}

.prod-img-wrapper {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.prod-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.prod-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.prod-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.6rem;
}

.prod-meta-barcode {
    font-family: monospace;
}

.prod-qty-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    min-width: 80px;
    flex-shrink: 0;
}
.light-theme .prod-qty-wrapper {
    background: var(--bg-app);
}
.qty-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.qty-values {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 2px;
}
.qty-checked-done {
    color: var(--primary);
}
.qty-checked-pending {
    color: var(--secondary);
}
.qty-slash {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.9rem;
}
.qty-total-val {
    color: var(--text-primary);
}

.qty-print-counter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.input-print-qty {
    width: 48px !important;
    height: 24px !important;
    padding: 2px 4px !important;
    font-size: 0.75rem !important;
    text-align: center;
    border-radius: 4px !important;
    border: 1px solid #cbd5e1 !important;
}
.light-theme .input-print-qty {
    background: #1f2937 !important;
    border-color: #4b5563 !important;
    color: #ffffff !important;
}

.prod-status-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.indicator-text {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.text-pending { color: var(--warning); }
.text-checked { color: var(--primary); }

/* Rodapé Ações do Pedido */
.details-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.item-progress-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.footer-buttons button {
    padding: 0.6rem 1.2rem;
    font-size: 0.88rem;
}

/* ==========================================================================
   SEÇÃO DE ETIQUETAS (BASE DA TELA: CONFIGURAÇÕES + MINI-PREVIEW EM 2 COLUNAS)
   ========================================================================== */
.label-bottom-section {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    flex-shrink: 0;
    height: 450px; /* Altura generosa no desktop para a etiqueta ficar grande */
    overflow: hidden;
    width: 100%;
}

.label-config-panel {
    flex: 1; /* 1/3 do espaço */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    height: 100%;
}

.configs-scroll-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

.mini-label-preview-panel {
    flex: 2; /* 2/3 do espaço */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
    min-width: 0;
    height: 100%;
}

.mini-preview-workspace {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    background-color: var(--bg-app);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
}

/* A etiqueta é renderizada em tamanho real (≈1171px) e reduzida via
   transform: scale() calculado por JS (fitMiniPreview) para caber aqui. */
.mini-preview-workspace .preview-label-wrapper {
    background: transparent;
    border: none;
    padding: 0;
    transform-origin: top center;
    flex-shrink: 0;
}

.label-print-btn {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
}

.preview-header h3 {
    margin-bottom: 0;
}

.preview-workspace {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0;
}

.preview-label-wrapper {
    background: #e2e8f0;
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.light-theme .preview-label-wrapper {
    background: #111827;
}

/* ==========================================================================
   CONFIGURAÇÕES COLAPSÁVEIS (DETAILS/SUMMARY)
   ========================================================================== */
.configs-accordion {
    flex-shrink: 0;
    padding: 0 !important; /* Reseta padding interno do panel-card para estilização do summary */
    overflow: hidden;
}

.configs-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    cursor: pointer;
    list-style: none;
    outline: none;
    user-select: none;
}

.configs-summary::-webkit-details-marker {
    display: none; /* Oculta seta nativa do Chrome */
}

.summary-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

/* Rotaciona a seta ao expandir */
details.configs-accordion[open] .summary-arrow {
    transform: rotate(180deg);
}

.configs-content {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.config-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.config-row {
    display: flex;
    gap: 0.6rem;
}

.width-50 {
    width: 50%;
}

.config-subtitle {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.3rem;
}

.checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-item label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* ==========================================================================
   ESTILOS ETIQUETA DE ENVIO UZE NAILS (100x150mm)
   ========================================================================== */
.uze-shipping-label {
    background-color: #ffffff !important;
    color: #000000 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: var(--print-margin) !important;
    box-sizing: border-box !important;
    border: 1px solid #000000 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    width: calc(var(--print-width) * 3.1) !important; /* Zoom para tela de tablet */
    height: calc(var(--print-height) * 3.1) !important;
    font-family: 'Inter', sans-serif !important;
    border-radius: 2px !important;
}

@media print {
    .print-label.uze-shipping-label {
        width: var(--print-width) !important;
        height: var(--print-height) !important;
        box-shadow: none !important;
        border: none !important;
        padding: var(--print-margin) !important;
        page-break-after: always !important;
        break-after: page !important;
    }
    .print-label.uze-shipping-label:last-child {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }
}

.uze-shipping-label * {
    color: #000000 !important;
    background-color: transparent !important;
}

.uze-shipping-label .label-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 2px !important;
}

.uze-shipping-label .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.uze-shipping-label .brand-icon-box {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
}

.uze-shipping-label .brand-svg-icon {
    width: 100% !important;
    height: 100% !important;
}

.uze-shipping-label .order-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.uze-shipping-label .order-num-text {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
}

.uze-shipping-label .brand-name-text {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    color: #444444 !important;
}

.uze-shipping-label .header-right {
    display: flex !important;
    align-items: center !important;
}

.uze-shipping-label .label-qr-code {
    width: 55px !important;
    height: 55px !important;
    object-fit: contain !important;
}

.uze-shipping-label .label-divider {
    border-bottom: 2px solid #000000 !important;
    margin: 6px 0 !important;
    width: 100% !important;
}

.uze-shipping-label .address-section {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    text-align: left !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.uze-shipping-label .address-section strong {
    font-weight: 700 !important;
}

.uze-shipping-label .items-section-title {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-align: left !important;
    margin-bottom: 5px !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
}

.uze-shipping-label .items-table-wrapper {
    flex: 1 !important;
    border: 1.5px solid #000000 !important;
    border-radius: 3px !important;
    overflow-y: auto !important;
    background-color: #ffffff !important;
    width: 100% !important;
}

.uze-shipping-label .items-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.75rem !important;
}

.uze-shipping-label .items-table th {
    font-weight: 700 !important;
    border-bottom: 1.5px solid #000000 !important;
    padding: 6px 8px !important;
    text-align: left !important;
    background-color: #f0f0f0 !important;
}

.uze-shipping-label .items-table td {
    padding: 6px 8px !important;
    border-bottom: 1px dashed #cccccc !important;
    text-align: left !important;
}

.uze-shipping-label .col-qtd {
    width: 55px !important;
    text-align: center !important;
}

.uze-shipping-label .items-table tbody td.col-qtd-val {
    text-align: center !important;
    font-weight: 700 !important;
}

.uze-shipping-label .label-footer-row {
    display: flex !important;
    justify-content: space-between !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    margin-top: 5px !important;
    width: 100% !important;
}

/* ==========================================================================
   RESPONSIVIDADE E ADAPTAÇÃO PARA TABLETS (SAMSUNG TAB A11 - 1280X800)
   ========================================================================== */
@media (max-width: 1280px) {
    body {
        overflow: hidden; /* Mantém sem rolagem no tablet */
    }

    .app-content {
        gap: 0.75rem;
        padding: 0.75rem;
        height: calc(100vh - 64px);
        overflow: hidden;
    }

    .checkout-row {
        flex: 1;
        height: auto;
        min-height: 0;
    }
    
    .label-bottom-section {
        height: 280px; /* Altura perfeita para visualização em tablet deitada */
    }
    
    .uze-shipping-label {
        width: calc(var(--print-width) * 2.5) !important;
        height: calc(var(--print-height) * 2.5) !important;
    }
    
    .entry-card {
        padding: 2rem;
    }
    
    .stat-card {
        min-width: 70px;
    }
}

@media (max-width: 1024px) {
    /* Tablet em Modo Retrato (800x1280) ou Telas menores */
    body {
        overflow: auto; /* Permite rolagem no portrait/mobile */
    }

    .app-content {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }
    
    .orders-queue-panel {
        width: 100%;
        height: 75px;
        margin-bottom: 0.5rem;
    }

    /* Em telas estreitas, bipagem e log empilham verticalmente */
    .checkout-row {
        flex-direction: column;
        flex: none;
    }

    .checkout-panel-container {
        width: 100%;
        height: 550px;
        overflow: hidden;
    }

    .order-details-panel {
        height: 380px;
        overflow: hidden;
    }

    .activity-log-panel {
        width: 100%;
        height: 160px;
        flex: none;
    }

    .label-bottom-section {
        flex-direction: column;
        height: auto;
        gap: 1rem;
    }

    .label-config-panel {
        flex: none;
        width: 100%;
        height: auto;
    }

    .configs-scroll-container {
        flex: none;
        overflow-y: visible;
        height: auto;
    }

    .mini-label-preview-panel {
        flex: none;
        width: 100%;
        height: 380px; /* Altura fixa para o preview quando empilhado */
    }

    .uze-shipping-label {
        width: calc(var(--print-width) * 2.8) !important;
        height: calc(var(--print-height) * 2.8) !important;
        margin: 0 auto;
    }
}

/* ==========================================================================
   LOG DE ATIVIDADES E BOTÕES DE RESET (RECONFERÊNCIA)
   ========================================================================== */
.details-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-small {
    height: 32px;
    padding: 0 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

#btn-reset-order:hover {
    background-color: var(--danger-bg);
    border-color: #fca5a5;
    color: var(--danger);
}

.btn-reset-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.btn-reset-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--danger);
}

.light-theme .btn-reset-item:hover {
    background: #374151;
    border-color: #4b5563;
}

.btn-reset-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Painel do Log (coluna lateral 1/4 da linha de bipagem) */
.activity-log-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0.8rem 1rem !important;
    overflow: hidden;
}

.activity-log-panel .log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3rem;
    margin-bottom: 0.4rem;
}

.activity-log-panel .log-header h3 {
    margin-bottom: 0;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.btn-clear-logs {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    transition: all 0.2s;
}

.btn-clear-logs:hover {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.log-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 2px;
}

.log-item {
    font-size: 0.76rem;
    font-family: monospace;
    line-height: 1.3;
    border-radius: 3px;
    padding: 0.15rem 0.35rem;
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
}

.log-time {
    color: var(--text-secondary);
    font-weight: 600;
    flex-shrink: 0;
}

.log-success {
    background-color: var(--success-bg);
    color: var(--primary) !important;
}

.log-error {
    background-color: var(--danger-bg);
    color: var(--danger) !important;
}

.log-warning {
    background-color: var(--warning-bg);
    color: var(--secondary) !important;
}

.log-info {
    color: var(--text-primary);
}

/* ==========================================================================
   PAINEL DE REGISTRO DE ITENS CONFERIDOS (antes da etiqueta)
   ========================================================================== */
.conferidos-registro-panel {
    flex-shrink: 0;
    padding: 0.6rem 0.9rem !important;
    max-height: 130px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow: hidden;
}

.registro-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    flex-shrink: 0;
}

.registro-header h3 {
    margin-bottom: 0;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.registro-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
}

.conferidos-registro-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow-y: auto;
    padding-right: 2px;
    align-content: flex-start;
}

.conferido-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--success-bg);
    border: 1px solid rgba(0, 173, 92, 0.3);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    max-width: 260px;
}

.conferido-chip-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.conferido-chip-name {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.conferido-chip-meta {
    font-size: 0.66rem;
    color: var(--text-secondary);
}

.conferido-chip-qty {
    font-weight: 800;
    color: var(--primary);
}

.btn-restart-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid rgba(0, 173, 92, 0.3);
    border-radius: 5px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-restart-chip:hover {
    background-color: var(--warning-bg);
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-restart-chip svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   ESTILOS TELA INDIVIDUOS - /etiquetas
   ========================================================================== */
#screen-etiquetas {
    display: none;
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
}

#app-container.step-etiquetas #screen-etiquetas {
    display: flex;
}

/* Sidebar Estilo Bling ERP */
.etiquetas-sidebar {
    width: 400px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--text-primary);
    flex-shrink: 0;
}

.etiquetas-sidebar .logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.etiquetas-sidebar .logo-text {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
}

.etiquetas-sidebar .sidebar-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.etiquetas-sidebar .section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.etiquetas-sidebar .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.etiquetas-sidebar label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.etiquetas-sidebar input[type="text"], 
.etiquetas-sidebar input[type="number"], 
.etiquetas-sidebar select {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.etiquetas-sidebar input[type="text"]:focus, 
.etiquetas-sidebar input[type="number"]:focus, 
.etiquetas-sidebar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 173, 92, 0.15);
}

/* Products Checkbox List (Scrollable box) */
.etiquetas-sidebar .product-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    background-color: var(--bg-app);
}

.etiquetas-sidebar .product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    transition: background-color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.etiquetas-sidebar .product-item:hover {
    background-color: var(--bg-card-hover);
    border-color: #cbd5e1;
}

.light-theme .etiquetas-sidebar .product-item:hover {
    border-color: #4b5563;
}

.etiquetas-sidebar .product-item.item-selected {
    border-color: var(--primary);
    background-color: var(--success-bg);
}

.etiquetas-sidebar .product-item input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.etiquetas-sidebar .product-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex-grow: 1;
}

.etiquetas-sidebar .product-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.etiquetas-sidebar .product-meta {
    font-size: 10px;
    color: var(--text-secondary);
}

.etiquetas-sidebar .product-qty-input {
    width: 60px;
    padding: 6px;
    font-size: 12px;
    text-align: center;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    flex-shrink: 0;
}

.etiquetas-sidebar .product-qty-input:focus {
    border-color: var(--primary);
    outline: none;
}

.etiquetas-sidebar .product-qty-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.etiquetas-sidebar .product-qty-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0;
    user-select: none;
}

/* Print Button in Sidebar */
.etiquetas-sidebar .btn-print {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.etiquetas-sidebar .btn-print:hover {
    background: var(--primary-hover);
}

.etiquetas-sidebar .btn-print:active {
    transform: scale(0.98);
}

.etiquetas-sidebar .sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.etiquetas-sidebar .btn-link-back {
    background: transparent;
    border: none;
    color: var(--text-secondary) !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    display: block;
    width: 100%;
    transition: color 0.2s;
}

.etiquetas-sidebar .btn-link-back:hover {
    color: var(--text-primary) !important;
    text-decoration: underline;
}

/* Workspace Preview Area */
.etiquetas-workspace {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 50%, var(--bg-panel) 0%, var(--bg-app) 100%);
    gap: 20px;
}

/* Label page design */
.etiquetas-workspace .printable-page {
    background-color: white;
    color: black;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
    position: relative;
    border-radius: 2px;
}

/* Base styles for labels (in browser view) */
.etiquetas-workspace .label-page {
    width: 350px;
    height: 520px;
    padding: 15px;
    font-family: Arial, sans-serif;
    border: 1px solid #000000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background-color: #ffffff;
}

.etiquetas-workspace .label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.etiquetas-workspace .label-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #000000 !important;
}

.etiquetas-workspace .label-qrcode {
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    padding: 3px;
}

.etiquetas-workspace .label-section {
    margin-bottom: 10px;
    text-align: left;
}

.etiquetas-workspace .label-section-title {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 10px;
    border-bottom: 1px solid #000000;
    margin-bottom: 4px;
    padding-bottom: 2px;
    color: #111111 !important;
}

.etiquetas-workspace .label-address-name {
    font-size: 13px;
    font-weight: bold;
    margin-top: 2px;
    color: #000000 !important;
}

.etiquetas-workspace .label-products-summary {
    font-size: 9px;
    border: 1px solid #000000;
    padding: 4px;
    background-color: #fafafa;
    height: 310px;
    box-sizing: border-box;
    overflow: hidden;
}

.etiquetas-workspace .prod-table {
    width: 100%;
    border-collapse: collapse;
}

.etiquetas-workspace .prod-table th, 
.etiquetas-workspace .prod-table td {
    text-align: left;
    padding: 3px 5px;
    font-size: 9px;
    color: #000000 !important;
}

.etiquetas-workspace .prod-table th {
    border-bottom: 1px solid #000000;
    font-weight: bold;
}

.etiquetas-workspace .prod-table td {
    border-bottom: 1px dashed #dddddd;
}

.etiquetas-workspace .label-details {
    border-top: 1.5px solid #000000;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    margin-top: 10px;
}

.etiquetas-workspace .label-details * {
    color: #000000 !important;
}

/* Estilos de Impressão */
#print-area {
    display: none;
}

@media print {
    #app-container, body > *:not(#print-area) {
        display: none !important;
    }
    #print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        padding: 0;
        width: var(--print-width);
    }
    @page {
        size: var(--print-width) var(--print-height);
        margin: 0;
    }
}

/* ==========================================================================
   TELA DE ETIQUETAS INDIVIDUAIS - RESPONSIVIDADE E FLUXOS
   ========================================================================== */

/* Layout dos Containers baseados em .order-loaded */
#screen-etiquetas:not(.order-loaded) {
    justify-content: center !important;
    align-items: center !important;
    padding: 2rem !important;
    background-color: var(--bg-app) !important;
}

#screen-etiquetas:not(.order-loaded) .etiquetas-entry-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#screen-etiquetas:not(.order-loaded) .etiquetas-workspace-container {
    display: none !important;
}

#screen-etiquetas.order-loaded .etiquetas-entry-container {
    display: none !important;
}

#screen-etiquetas.order-loaded .etiquetas-workspace-container {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: row;
}

/* Responsividade para Tablets e Telas Menores */
@media (max-width: 1024px) {
    #screen-etiquetas.order-loaded .etiquetas-workspace-container {
        flex-direction: column !important;
        overflow-y: auto !important;
        height: 100vh !important;
    }
    
    .etiquetas-sidebar {
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        flex-shrink: 0 !important;
    }
    
    .etiquetas-workspace {
        width: 100% !important;
        height: auto !important;
        padding: 20px !important;
        flex-grow: 1 !important;
    }
}

/* ==========================================================================
   ESTILOS TELA SEPARADOR - /separador
   ========================================================================== */
#screen-separador {
    display: none;
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
}

#app-container.step-separador #screen-separador {
    display: flex;
    flex-direction: column;
}

.separator-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    height: calc(100vh - 64px);
    padding: 20px;
    overflow: hidden;
    background-color: var(--bg-app);
    box-sizing: border-box;
}

.separador-main-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.separador-entry-view {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.entry-subcard {
    max-width: 480px;
    width: 100%;
    padding: 30px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-main);
    text-align: center;
}

.separador-details-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    overflow: hidden;
}

.camera-stream-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-main);
}

.recording-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 5;
}

.rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: red;
    animation: pulse 1s infinite alternate;
    display: inline-block;
}

.separator-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background-color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.separator-item:hover {
    background-color: var(--bg-card-hover);
}

.separator-item.item-conferido {
    background-color: var(--success-bg);
    border-color: var(--primary);
}

.btn-qty-control:hover {
    background-color: var(--bg-card-hover) !important;
    border-color: var(--text-secondary) !important;
}

.btn-qty-control:active {
    transform: scale(0.95);
}

.capture-thumb-container {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.capture-thumb-container:hover {
    transform: scale(1.05);
}

/* Spinner Custom */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin-anim 1s linear infinite;
}

@keyframes spin-anim {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Responsividade para Tablets e Telas Menores */
@media (max-width: 900px) {
    .separator-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        overflow-y: auto;
    }
}

/* ==========================================================================
   MENU PRINCIPAL DE EXPEDIÇÃO (TELA TABLET / ROTA /expedicao)
   ========================================================================== */
#app-container.step-expedicao #screen-expedicao-inicio {
    display: flex;
    flex-direction: column;
}

#screen-expedicao-inicio {
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-app);
}

#screen-expedicao-inicio .menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    max-width: 650px; /* Otimizado para visualização vertical (Samsung Tab A11) */
    margin: 0 auto;
    width: 100%;
}

#screen-expedicao-inicio .menu-welcome {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

#screen-expedicao-inicio .menu-welcome h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#screen-expedicao-inicio .menu-welcome p {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

#screen-expedicao-inicio .menu-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-main);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    width: 100%;
}

#screen-expedicao-inicio .menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.15);
}

/* Card Gigante para Buscar Próximo */
#screen-expedicao-inicio .card-main-proximo {
    border: 2px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 173, 92, 0.1);
    padding: 3.5rem 2rem;
    border-radius: 24px;
    margin-bottom: 1.5rem;
}

#screen-expedicao-inicio .card-main-proximo:hover {
    box-shadow: 0 15px 35px rgba(0, 173, 92, 0.18);
}

#screen-expedicao-inicio .card-main-proximo h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

#screen-expedicao-inicio .card-main-proximo p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Linha inferior para as duas opções secundárias */
#screen-expedicao-inicio .menu-row-bottom {
    display: flex;
    gap: 1.25rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

#screen-expedicao-inicio .menu-row-bottom .card-secondary {
    flex: 1;
    min-height: 220px;
    padding: 1.75rem 1.25rem;
    justify-content: flex-start;
}

#screen-expedicao-inicio .menu-row-bottom .card-secondary h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
}

#screen-expedicao-inicio .card-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-app);
    transition: background-color 0.2s;
}

#screen-expedicao-inicio .card-main-proximo .card-icon-wrapper {
    width: 90px;
    height: 90px;
}

#screen-expedicao-inicio .menu-card:hover .card-icon-wrapper {
    background-color: var(--border-color);
}

#screen-expedicao-inicio .card-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

#screen-expedicao-inicio .card-main-proximo .card-icon-wrapper svg {
    width: 44px;
    height: 44px;
}

#screen-expedicao-inicio .icon-proximo svg {
    color: var(--primary);
}

#screen-expedicao-inicio .icon-especifico svg {
    color: #878787;
}

#screen-expedicao-inicio .icon-pausado svg {
    color: var(--secondary);
}

#screen-expedicao-inicio .menu-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

#screen-expedicao-inicio .menu-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
}

#screen-expedicao-inicio .menu-card-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
}

#screen-expedicao-inicio .search-input-wrapper {
    border-radius: 8px;
    overflow: hidden;
}

#screen-expedicao-inicio .btn-large {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

#screen-expedicao-inicio .btn-giant {
    padding: 18px 30px;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(0, 173, 92, 0.25);
}

#screen-expedicao-inicio .btn-large:active,
#screen-expedicao-inicio .btn-giant:active {
    transform: scale(0.98);
}

#screen-expedicao-inicio .btn-warning {
    background-color: var(--secondary);
    color: white;
}

#screen-expedicao-inicio .btn-warning:hover:not(:disabled) {
    background-color: var(--secondary-hover);
}

#screen-expedicao-inicio .btn-warning:disabled {
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsividade adicional para celulares bem pequenos */
@media (max-width: 520px) {
    #screen-expedicao-inicio .menu-content {
        padding: 1rem;
    }
    
    #screen-expedicao-inicio .menu-welcome h2 {
        font-size: 1.75rem;
    }

    #screen-expedicao-inicio .menu-row-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    
    #screen-expedicao-inicio .menu-row-bottom .card-secondary {
        min-height: auto;
    }
}

/* ==========================================================================
   TELA DE VALIDAÇÃO DE PRATELEIRA (ETAPA PICKING / SCREEN 6)
   ========================================================================== */
#app-container.step-validacao-prateleira #screen-validacao-prateleira {
    display: flex;
    flex-direction: column;
}

#screen-validacao-prateleira {
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-app);
}

#screen-validacao-prateleira .shelf-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    max-width: 650px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

#screen-validacao-prateleira .shelf-progress-container {
    width: 100%;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#screen-validacao-prateleira .shelf-progress-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
}

#screen-validacao-prateleira .shelf-progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

#screen-validacao-prateleira .shelf-progress-bar {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

#screen-validacao-prateleira .shelf-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: var(--shadow-main);
}

#screen-validacao-prateleira .shelf-product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

#screen-validacao-prateleira .shelf-product-image-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#screen-validacao-prateleira .shelf-product-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#screen-validacao-prateleira .shelf-product-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

#screen-validacao-prateleira .shelf-location-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--warning-bg);
    border: 1px solid rgba(243, 146, 0, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    margin-top: 0.5rem;
    width: 100%;
}

#screen-validacao-prateleira .location-label {
    font-size: 0.95rem;
    color: var(--warning);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#screen-validacao-prateleira .location-value {
    font-size: 1.35rem;
    color: var(--warning);
    font-weight: 800;
}

#screen-validacao-prateleira .shelf-validation-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    background-color: var(--bg-app);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

#screen-validacao-prateleira .shelf-validation-box label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

#screen-validacao-prateleira .shelf-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
}

#screen-validacao-prateleira .shelf-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    padding: 6px 0;
}

#screen-validacao-prateleira .shelf-feedback-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

#screen-validacao-prateleira .shelf-feedback-message.feedback-success {
    color: var(--success);
}

#screen-validacao-prateleira .shelf-feedback-message.feedback-error {
    color: var(--danger);
}

#screen-validacao-prateleira .shelf-qty-reveal-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#screen-validacao-prateleira .qty-reveal-card {
    width: 100%;
    background-color: var(--success-bg);
    border: 2px dashed var(--primary);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

#screen-validacao-prateleira .qty-label {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

#screen-validacao-prateleira .qty-value {
    font-size: 3.5rem;
    color: var(--primary);
    font-weight: 800;
    line-height: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para a lista de lotes na tela de validação */
#screen-validacao-prateleira .shelf-lote-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    animation: slideUp 0.2s ease-out;
}

#screen-validacao-prateleira .shelf-lote-tag {
    font-family: monospace;
    color: var(--text-primary);
}

#screen-validacao-prateleira .shelf-lote-qty {
    background-color: var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

#screen-validacao-prateleira .btn-remove-lote {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0 4px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

#screen-validacao-prateleira .btn-remove-lote:hover {
    transform: scale(1.25);
}

/* ==========================================================================
   TRANSITION MODAL FOR ORDER STATUS CHANGE
   ========================================================================== */
.transition-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.transition-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.transition-modal {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 92%;
    max-width: 480px;
    box-shadow: var(--shadow-main);
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.transition-modal-overlay.show .transition-modal {
    transform: scale(1);
}

.transition-modal-header {
    background-color: var(--header-bg);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.transition-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.transition-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.transition-modal-close:hover {
    opacity: 0.8;
}

.transition-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transition-modal-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.45;
}

.transition-options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.transition-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.transition-option-btn:hover {
    border-color: var(--primary);
    background-color: var(--bg-card-hover);
    transform: translateY(-1px);
}

.transition-option-btn:active {
    transform: translateY(0);
}

.transition-option-icon {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.transition-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--bg-card-hover);
}

.transition-modal-btn-cancel {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-panel);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

/* Sugestões de Localização da Caixa (E1 a E22) */
.loc-suggestions-container {
    margin-top: 10px;
}

.loc-suggestions-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.loc-suggestions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
    padding: 2px;
}

.loc-suggestion-chip {
    padding: 8px 13px;
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-panel);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.loc-suggestion-chip:hover {
    border-color: var(--primary);
    background-color: var(--bg-card-hover);
    transform: translateY(-1px);
}

.loc-suggestion-chip.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 112, 243, 0.35);
}

.loc-suggestion-chip:active {
    transform: scale(0.95);
}

.transition-modal-btn-cancel:hover {
    background-color: var(--bg-app);
    color: var(--text-primary);
}


/* ==========================================================================
   TELA DE EXPEDIÇÃO PARA TABLET GALAXY TAB (VERTICAL / PORTRAIT)
   ========================================================================== */

#app-container.step-pedido-tablet #screen-pedido-tablet {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.tablet-header {
    background-color: var(--bg-panel);
    border-bottom: 2px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.tablet-search-container {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 320px;
}

.tablet-search-container input {
    flex: 1;
    padding: 8px 12px;
    font-size: 16px; /* Evita zoom automático no iOS/Android */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-primary);
}

.tablet-main-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
}

.tablet-workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 16px;
}

/* abas estilo tablet */
.tablet-tabs-nav {
    display: flex;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.tablet-tab-btn {
    flex: 1;
    padding: 14px 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-step-num {
    display: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    font-weight: 800;
    align-items: center;
    justify-content: center;
}

.tab-full-title {
    display: inline;
}

.tab-short-title {
    display: none;
}

.tablet-tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.tablet-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: rgba(139, 92, 246, 0.05);
}

.tablet-tab-btn.active .tab-step-num {
    background-color: var(--primary);
    color: #fff;
}

/* panels */
.tablet-tab-panel {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.tablet-tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Aba 1: Dados do Pedido */
.tablet-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

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

.info-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary);
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.info-group span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.highlight-box {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1.5px solid var(--danger);
    border-radius: 8px;
    padding: 10px 12px;
}

.highlight-box label {
    color: var(--danger);
    font-weight: 700;
}

.highlight-box p {
    margin: 4px 0 0 0;
    font-weight: 600;
    color: var(--text-primary);
}

.obs-text {
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-line;
    color: var(--text-primary);
    margin: 4px 0 0 0;
}

/* Aba 2: Produtos */
.tablet-scan-bar {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tablet-scan-bar .scan-input-wrapper {
    display: flex;
    gap: 8px;
    width: 100%;
}

.tablet-scan-bar input {
    flex: 1;
    font-size: 18px; /* tamanho bom para digitação */
}

.tablet-products-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tablet-product-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s ease;
}

.tablet-product-card.checked {
    border: 2px solid var(--success);
    background-color: rgba(16, 185, 129, 0.03);
}

.tablet-product-card.partial {
    border: 2px solid var(--warning);
    background-color: rgba(245, 158, 11, 0.03);
}

.tablet-prod-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tablet-prod-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 6px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 2px;
    flex-shrink: 0;
}

.tablet-prod-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tablet-prod-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.25;
}

.tablet-prod-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tablet-location-pill {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    margin-top: 2px;
    border: 1px solid #cbd5e1;
}
.dark-theme .tablet-location-pill {
    background-color: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

.tablet-prod-qty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 80px;
}

.qty-label-small {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.qty-val-large {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.checked .qty-val-large {
    color: var(--success);
}

.tablet-prod-actions {
    display: flex;
    gap: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
}

.tablet-prod-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 6px;
}

/* Lotes */
.tablet-prod-lotes-section {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tablet-lotes-input-row {
    display: flex;
    gap: 6px;
}

.tablet-lotes-input-row input {
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-panel);
    color: var(--text-primary);
}

.tablet-lotes-list-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.tablet-lotes-list-table th, .tablet-lotes-list-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tablet-lotes-list-table th {
    font-weight: 700;
    color: var(--text-secondary);
}

.btn-delete-lote {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
}

/* Galeria de Fotos no Produto */
.tablet-prod-gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.tablet-gallery-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.tablet-gallery-img:hover {
    transform: scale(1.05);
}

.tablet-gallery-item-container {
    position: relative;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

.tablet-gallery-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--danger, #ef4444);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: background-color 0.2s, transform 0.2s;
}

.tablet-gallery-remove-btn:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

/* Aba 3: Volumetria */
.volumetria-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.volumetria-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
}

.volumetria-card .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .volumetria-card .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.volumetria-card .form-group input, .volumetria-card .form-group select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-primary);
}

/* Aba 4: Etiquetas */
.etiquetas-grid-container {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.etiquetas-grid-container h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
}

.etiquetas-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .etiquetas-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .etiquetas-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.btn-print-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.25s ease;
}

.btn-print-action:hover {
    border-color: var(--primary);
    background-color: var(--bg-card-hover);
    transform: translateY(-2px);
}

.print-icon-box {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-icon-box svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.btn-print-action span {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

/* Tablet Footer sticky */
.tablet-footer {
    position: sticky;
    bottom: 0;
    background-color: var(--bg-panel);
    border-top: 2.5px solid var(--border-color);
    padding: 14px 16px;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 100;
}

.tablet-progress-summary {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tablet-progress-summary strong {
    font-size: 1.25rem;
    font-weight: 800;
}

/* Mobile Navigation Bar & Drawer Styles */
.tablet-mobile-nav-bar {
    display: none;
    margin-bottom: 12px;
}

.tablet-drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tablet-drawer-backdrop.open {
    display: block;
    opacity: 1;
}

.tablet-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 340px;
    height: 100%;
    background-color: var(--bg-panel);
    border-right: 2px solid var(--border-color);
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    flex-direction: column;
}

.tablet-drawer.open {
    display: flex;
    transform: translateX(0);
}

.tablet-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

.drawer-header-sub {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 700;
}

.drawer-header-title {
    margin: 2px 0 0 0;
    font-size: 1.2rem;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.tablet-drawer-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s;
}

.tablet-drawer-close-btn:hover {
    color: var(--text-primary);
}

.tablet-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.drawer-step-item:hover {
    background-color: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.4);
}

.drawer-step-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.06));
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.drawer-step-num {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drawer-step-item.active .drawer-step-num {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.drawer-step-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-step-details strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.drawer-step-item.active .drawer-step-details strong {
    color: var(--primary);
}

.drawer-step-details span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.drawer-step-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.drawer-step-item.active .drawer-step-badge {
    background-color: var(--primary);
    color: #fff;
}

.drawer-summary-card {
    margin-top: auto;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-summary-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.drawer-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.drawer-summary-row span {
    color: var(--text-secondary);
}

.drawer-summary-row strong {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .tablet-header {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .tablet-header .header-left-group {
        flex: 1;
    }

    .tablet-search-container {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    /* No celular: Esconde as abas horizontais e exibe a barra superior com o botão hambúrguer do menu suspenso */
    .tablet-tabs-nav {
        display: none !important;
    }

    .tablet-mobile-nav-bar {
        display: block;
    }

    .tablet-drawer-toggle-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background-color: var(--bg-panel);
        border: 1.5px solid var(--border-color);
        border-radius: 10px;
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .tablet-drawer-toggle-btn:hover {
        border-color: var(--primary);
        background-color: rgba(139, 92, 246, 0.04);
    }

    .drawer-toggle-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .drawer-hamburger-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background-color: rgba(139, 92, 246, 0.12);
        color: var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .drawer-current-step-box {
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left;
    }

    .mobile-step-badge {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background-color: var(--primary);
        color: #fff;
        font-size: 0.8rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mobile-step-info {
        display: flex;
        flex-direction: column;
    }

    .mobile-step-sub {
        font-size: 0.72rem;
        color: var(--text-secondary);
        line-height: 1.1;
    }

    .mobile-step-name {
        font-size: 0.95rem;
        color: var(--text-primary);
        font-family: 'Outfit', sans-serif;
    }

    .drawer-toggle-right {
        display: flex;
        align-items: center;
        gap: 4px;
        color: var(--text-secondary);
        font-size: 0.82rem;
        font-weight: 600;
    }

    .tablet-footer {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .tablet-progress-summary {
        text-align: center;
        width: 100%;
    }

    .tablet-footer-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .tablet-footer-actions button {
        flex: 1;
        padding: 12px;
        font-size: 1rem !important;
    }

    .tablet-scan-bar .scan-input-wrapper {
        flex-wrap: nowrap;
    }
}

/* Modals */
.hidden-modal {
    display: none;
}

#tablet-camera-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#tablet-camera-modal.active {
    display: flex;
}

.modal-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 16px;
}

.camera-stream-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    aspect-ratio: 4/3;
    background-color: #000;
}

.camera-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger);
    display: inline-block;
    align-self: center;
}

.camera-status-dot.active {
    background-color: var(--success);
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

#tablet-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 16px;
}

#tablet-loading-overlay.hidden {
    display: none;
}

/* Modal de Código de Usuário */
#tablet-user-code-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#tablet-user-code-modal.active {
    display: flex;
}

/* Tela Secreta de Usuários */
#app-container.step-expedicao-usuario #screen-expedicao-usuario {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--bg-app);
    color: var(--text-primary);
}

/* ==========================================================================
   TELA DE CONFERÊNCIA DE EXTRATO (/expedicao/extratos/conferencia)
   ========================================================================== */
.extrato-conf-main {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--bg-app);
}

/* Barra de Busca */
.extrato-conf-search-card {
    padding: 1.25rem 1.5rem;
    background: var(--bg-panel);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
}

.search-form-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.search-input-group {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    pointer-events: none;
}

#extrato-conf-txt-pedido {
    width: 100%;
    padding: 10px 38px 10px 38px;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

#extrato-conf-txt-pedido:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-clear-search:hover {
    color: var(--text-primary);
}

.search-actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.demo-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.demo-toggle-wrap input[type="checkbox"] {
    accent-color: #f59e0b;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.search-quick-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.chips-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.quick-chip {
    padding: 3px 10px;
    font-size: 0.8rem;
    border-radius: 12px;
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.25);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.quick-chip:hover {
    background: #0284c7;
    color: #ffffff;
    transform: translateY(-1px);
}

.search-feedback-box {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Estado Vazio & Loading */
.extrato-conf-empty-card,
.extrato-conf-loading-card {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-panel);
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.empty-icon-wrap {
    color: var(--text-secondary);
    opacity: 0.6;
}

.extrato-conf-empty-card h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.extrato-conf-empty-card p,
.extrato-conf-loading-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 480px;
}

.spinner-large {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(2, 132, 199, 0.2);
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Hero Resumo */
.extrato-conf-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 1.25rem 1.5rem;
    background: var(--bg-panel);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-title-row h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.badge-demo {
    padding: 2px 7px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    background: #f59e0b;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.hero-client-row {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-client-row strong {
    color: var(--text-primary);
}

.client-doc {
    font-family: monospace;
    font-size: 0.85rem;
    background: var(--bg-app);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.hero-metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-metrics .metric-item {
    display: flex;
    flex-direction: column;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    min-width: 120px;
}

.hero-metrics .metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.hero-metrics .metric-value {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Barra de Abas */
.extrato-conf-tabs-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0 0 0;
    border-bottom: 2px solid var(--border-color);
    margin-top: 8px;
    scrollbar-width: thin;
}

.extrato-conf-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.extrato-conf-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.light-theme .extrato-conf-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.extrato-conf-tab-btn.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 7px;
    font-size: 0.72rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
    font-weight: 700;
}

.light-theme .tab-badge {
    background: rgba(255, 255, 255, 0.12);
}

.extrato-conf-tab-btn.active .tab-badge {
    background: rgba(2, 132, 199, 0.2);
    color: #0284c7;
}

/* Painéis */
.extrato-conf-panel {
    display: none;
    animation: fadeInExtrato 0.2s ease-in-out;
    padding-top: 8px;
}

.extrato-conf-panel.active {
    display: block;
}

@keyframes fadeInExtrato {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grids & Cards */
.panel-grid-2cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.info-section-card {
    padding: 1.25rem;
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.card-section-title {
    font-size: 0.98rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.info-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.info-data-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-data-item .label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.info-data-item .value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.chave-copia-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-copy-chip {
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-copy-chip:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Observações */
.obs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.obs-block {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.obs-interna {
    background-color: #fff7ed;
    border-left: 4px solid #f97316;
    color: #9a3412;
}

.light-theme .obs-interna {
    background-color: #431407;
    border-left-color: #f97316;
    color: #fdba74;
}

.obs-cliente {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.light-theme .obs-cliente {
    background-color: #172554;
    border-left-color: #3b82f6;
    color: #93c5fd;
}

.notes-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
}

.note-item {
    font-size: 0.88rem;
    padding: 6px 10px;
    background: var(--bg-app);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.note-item .note-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-right: 6px;
}

/* Operadores */
.operators-highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.operator-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    box-shadow: var(--shadow-main);
}

.operator-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--bg-app);
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.operator-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.operator-role-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.role-conferente .operator-role-tag {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.light-theme .role-conferente .operator-role-tag {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #059669;
}

.role-separador .operator-role-tag {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.light-theme .role-separador .operator-role-tag {
    background: #1e3a8a;
    color: #93c5fd;
    border-color: #2563eb;
}

.operator-details h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.operator-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.operators-envolvidos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.operator-envolvido-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Bipagens & Lotes */
.progress-summary-card {
    padding: 1.25rem 1.5rem;
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.progress-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-summary-top h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.progress-summary-top p {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--bg-app);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: var(--success);
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* Tabela Personalizada */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.custom-table th {
    background: var(--bg-app);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.product-thumb-small {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 2px;
}

.product-name-title {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-meta-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.lot-badge-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: monospace;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin: 2px 4px 2px 0;
}

.light-theme .lot-badge-item {
    background: rgba(255, 255, 255, 0.08);
}

/* Volumes */
.volumes-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.metric-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
}

.metric-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.metric-card-val {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-card-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Fotos */
.photos-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.photos-filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.photos-help-tip {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.extrato-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.extrato-photo-card {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: var(--bg-panel);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.extrato-photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.extrato-photo-img-wrap {
    position: relative;
    width: 100%;
    height: 160px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.extrato-photo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.extrato-photo-card:hover .extrato-photo-img-wrap img {
    transform: scale(1.04);
}

.extrato-photo-card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.extrato-photo-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.extrato-photo-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.empty-photos-box {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    margin-top: 14px;
}

/* Logs */
.logs-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.logs-type-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-log-btn {
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-log-btn:hover {
    color: var(--text-primary);
}

.filter-log-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.logs-search-wrap input {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    min-width: 240px;
}

.logs-search-wrap input:focus {
    outline: none;
    border-color: #0284c7;
}

.logs-stats-tag {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.logs-stats-tag strong {
    color: var(--text-primary);
}

.extrato-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.timeline-log-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 14px;
    background: var(--bg-panel);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    font-size: 0.88rem;
    transition: background-color 0.1s;
}

.timeline-log-row:hover {
    background-color: var(--bg-card-hover);
}

.timeline-log-row.log-success { border-left-color: var(--success); }
.timeline-log-row.log-warning { border-left-color: var(--warning); }
.timeline-log-row.log-error { border-left-color: var(--danger); }
.timeline-log-row.log-info { border-left-color: #0284c7; }

.timeline-log-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.timeline-log-time {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.timeline-log-action-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.timeline-log-message {
    color: var(--text-primary);
    word-break: break-word;
    font-weight: 500;
}

.timeline-log-operator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
    flex-shrink: 0;
}

.light-theme .timeline-log-operator {
    background: #1e3a8a;
    color: #bfdbfe;
    border-color: #2563eb;
}

.timeline-log-operator.system-op {
    background: var(--bg-app);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* Lightbox Modal */
.extrato-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.extrato-lightbox-overlay.hidden {
    display: none !important;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.lightbox-container {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.lightbox-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 28px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.15s;
}

.lightbox-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    max-height: 75vh;
    overflow: hidden;
}

.lightbox-image-wrap img {
    max-width: 85vw;
    max-height: 75vh;
    object-fit: contain;
}

.lightbox-footer {
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
}

.lightbox-caption {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lightbox-action-link {
    font-size: 0.85rem;
    color: #0284c7;
    text-decoration: underline;
    font-weight: 500;
}

