/* ==========================================================================
   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: #2e3a4e;            /* Azul Escuro Bling 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: #1e3a8a;
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 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;
}

/* ==========================================================================
   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: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.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: #eff6ff; color: #3b82f6; border: 1px solid rgba(59, 130, 246, 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;
    }
}
