/* =====================================================================
   DESIGN SYSTEM - CHECKNOTA MÓVEL
   Estilo Premium para aplicação de conferência de estoque
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Cores do Tema */
    --primary-dark: #0f1e36;    /* Azul Escuro Principal */
    --primary-blue: #3b5a80;    /* Azul Médio */
    --accent-blue: #648dae;     /* Azul Claro */
    --bg-light: #f7f9fb;        /* Fundo Geral */
    --card-bg: #ffffff;         /* Fundo de Card */
    --border-color: #eef2f6;    /* Cor de Borda */
    
    /* Cores de Feedback */
    --color-success: #10b981;   /* Verde Sucesso */
    --color-success-bg: #ecfdf5;
    --color-danger: #ef4444;    /* Vermelho Alerta/Divergência */
    --color-danger-bg: #fef2f2;
    --color-warning: #f59e0b;   /* Laranja Atenção */
    --color-warning-bg: #fffbeb;
    
    /* Escala de Cinzas */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Fontes e Sombras */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Geral */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Layout Principal e Container */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-light);
    position: relative;
    padding-bottom: 80px; /* Espaço para o menu de navegação inferior */
}

/* Cabeçalho da Aplicação */
.app-header {
    background-color: var(--card-bg);
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary-dark);
}

.app-logo span {
    color: var(--primary-blue);
}

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-online {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.status-offline {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
}

/* Telas (Views) - Gerenciamento de Visibilidade */
.app-view {
    display: none;
    padding: 20px;
    animation: slideUp 0.4s ease;
}

.app-view.active {
    display: block;
}

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

/* Componentes de Texto */
.view-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.view-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Cards Estilizados */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(238, 242, 246, 0.8);
    position: relative;
    overflow: hidden;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Grid de Indicadores (Dashboard) */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.metric-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.metric-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
}

.metric-unit {
    font-size: 14px;
    color: var(--text-secondary);
}

.metric-trend {
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.trend-up {
    color: var(--color-success);
}

.trend-down {
    color: var(--color-danger);
}

/* Card Especial de Progresso */
.progress-card {
    background: linear-gradient(135deg, #102a43 0%, #1e293b 100%);
    color: #ffffff;
    border: none;
}

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

.progress-title {
    font-size: 16px;
    font-weight: 600;
}

.progress-badge {
    background-color: rgba(255, 255, 255, 0.2);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.progress-sub {
    font-size: 12px;
    color: var(--accent-blue);
    margin-bottom: 16px;
}

.progress-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.progress-bar-container {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-footer {
    font-size: 11px;
    font-style: italic;
    color: #94a3b8;
}

/* Área de Scan e Leitores */
.scan-area {
    border: 2px dashed var(--text-muted);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    background-color: rgba(247, 249, 251, 0.5);
    transition: var(--transition-smooth);
}

.scan-area:hover {
    border-color: var(--primary-blue);
    background-color: rgba(94, 124, 226, 0.05);
}

.scan-laser {
    width: 80%;
    height: 2px;
    background-color: var(--color-danger);
    position: absolute;
    top: 50%;
    left: 10%;
    box-shadow: 0 0 8px var(--color-danger);
    animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
    0%, 100% { top: 30%; }
    50% { top: 70%; }
}

.scan-label {
    margin-top: 15px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
}

.scan-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Botões Modernos */
.btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary-dark);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1a2f50;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--primary-blue);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #2e4768;
}

.btn-danger-outline {
    background-color: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    box-shadow: none;
}

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

.btn-success {
    background-color: var(--color-success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
}

/* Divisórias de Layout */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
    margin-right: 15px;
}

.divider:not(:empty)::after {
    margin-left: 15px;
}

/* Componentes de Formulário */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 15px 12px 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--text-muted);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background-color: #ffffff;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 90, 128, 0.15);
}

/* Estilo para Caixa de Notas Pendentes (Ambiente de Bipar Nota) */
.test-panel {
    background-color: var(--card-bg);
    border: 1px solid #dbeaf8;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 15px;
}

.test-panel-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.test-notes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.test-note-btn {
    background-color: #f1f7fc;
    border: 1px solid #dbeaf8;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.test-note-btn:hover {
    background-color: #e1eef9;
    border-color: var(--accent-blue);
}

.test-note-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark);
}

.test-note-sub {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Dica de Operação */
.tip-card {
    background-color: var(--color-warning-bg);
    border-left: 4px solid var(--color-warning);
    border-radius: 4px;
    padding: 14px;
    display: flex;
    gap: 12px;
}

.tip-icon {
    color: var(--color-warning);
    display: flex;
    align-items: flex-start;
    margin-top: 2px;
}

.tip-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #92400e;
    margin-bottom: 4px;
}

.tip-text {
    font-size: 11px;
    color: #b45309;
}

/* Lista de Histórico de Notas */
.history-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 18px;
    padding-bottom: 4px;
}

.filter-btn {
    background-color: #e2e8f0;
    color: var(--text-secondary);
    border: none;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.history-item {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--text-muted);
    transition: var(--transition-smooth);
}

.history-item.status-sucesso {
    border-left-color: var(--color-success);
}

.history-item.status-divergencia {
    border-left-color: var(--color-danger);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
}

.history-date {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.history-loja {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.history-status-msg {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-sucesso .history-status-msg {
    color: var(--color-success);
}

.status-divergencia .history-status-msg {
    color: var(--color-danger);
}

.history-details {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    background-color: var(--bg-light);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    border-left: 2px solid var(--color-danger);
}

/* Painel do ERP */
.erp-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    padding: 15px;
    transition: var(--transition-smooth);
}

.erp-card:hover {
    box-shadow: var(--shadow-sm);
}

.erp-card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.erp-key {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
}

.erp-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.erp-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-blue);
    text-decoration: none;
    margin-top: 10px;
    cursor: pointer;
}

.erp-action:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Cartão Informativo de VPS */
.vps-card {
    background-color: #fffaf0;
    border: 1px solid #feebc8;
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-top: 20px;
}

.vps-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #c05621;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vps-text {
    font-size: 12px;
    color: #7b341e;
    line-height: 1.6;
}

/* Desempenho da Equipe (Lista de Colaboradores) */
.team-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.team-item:last-child {
    border-bottom: none;
}

.team-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #dbeaf8;
    color: var(--primary-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
}

.team-info-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.team-info-stats {
    font-size: 11px;
    color: var(--text-secondary);
}

.team-badge {
    background-color: #ecfdf5;
    color: var(--color-success);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Navegação Inferior (Abas do App) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 64px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    flex: 1;
    height: 100%;
    transition: var(--transition-smooth);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    transition: var(--transition-smooth);
}

.nav-item.active {
    color: #3b82f6;
}

.nav-item.active svg {
    color: #3b82f6;
    transform: translateY(-2px);
}

/* =====================================================================
   TELA DE CONFERÊNCIA FÍSICA (TELA DE TRABALHO)
   ===================================================================== */
.conferencia-header {
    background-color: var(--primary-dark);
    color: #ffffff;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.conf-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
}

.conf-meta-label {
    color: var(--accent-blue);
    font-weight: 600;
}

.conf-meta-val {
    font-weight: 700;
}

.product-list {
    margin-bottom: 20px;
}

.product-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    position: relative;
    border-left: 4px solid var(--primary-blue);
    transition: var(--transition-smooth);
}

.product-item.conferido-completo {
    border-left-color: var(--color-success);
    background-color: #f8fafc;
}

.product-item.conferido-divergente {
    border-left-color: var(--color-danger);
}

.prod-ref {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.prod-desc {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-right: 40px; /* Espaço para o botão de opções */
}

.prod-loc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #c27803;
    background-color: #fef3c7;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 12px;
}

.prod-qty-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.qty-counter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-qty {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--primary-blue);
    background-color: transparent;
    color: var(--primary-blue);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-qty:hover {
    background-color: var(--primary-blue);
    color: #ffffff;
}

.qty-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #f8fafc;
    padding: 4px;
    outline: none;
    -moz-appearance: textfield;
}

.qty-val::-webkit-outer-spin-button,
.qty-val::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-expected {
    font-size: 12px;
    color: var(--text-secondary);
}

.qty-expected span {
    font-weight: 700;
    color: var(--primary-dark);
}

/* Opções de Ocorrência (Avaria / Falta) */
.occ-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

.btn-occ {
    padding: 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--text-muted);
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
}

.btn-occ.active-avaria {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-occ.active-falta {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border-color: var(--color-warning);
}

/* Modal / Configuração */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #ffffff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 400px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.modal-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

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

/* Spinner de Loading */
.spinner-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.spinner-text {
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Leitor de Câmera Real */
#camera-reader {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 15px;
    display: none;
    border: 2px solid var(--primary-dark);
}

.camera-container-active {
    position: relative;
}

.close-camera-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--color-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

/* Badges de Prazo */
.prazo-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.prazo-badge.prazo-ok {
    background-color: #ecfdf5;
    color: var(--color-success);
}

.prazo-badge.prazo-atraso {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
}

/* Filtros de Loja e Data no Dashboard */
.filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.multiselect-dropdown {
    position: relative;
    flex: 1;
}

.multiselect-btn {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.multiselect-btn:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    color: var(--text-secondary);
}

.multiselect-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.multiselect-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.multiselect-dropdown.open .multiselect-menu {
    display: block;
}

.multiselect-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    gap: 8px;
    user-select: none;
}

.multiselect-item:hover {
    background-color: var(--bg-light);
}

.multiselect-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1px solid var(--text-muted);
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.date-option {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
    user-select: none;
}

.date-option:hover {
    background-color: var(--bg-light);
    color: var(--primary-blue);
}

.date-option.selected {
    background-color: var(--bg-light);
    color: var(--primary-blue);
    font-weight: 700;
}

.date-input {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-primary);
    outline: none;
    background-color: var(--bg-light);
    transition: border-color 0.2s ease;
}

.date-input:focus {
    border-color: var(--primary-blue);
    background-color: var(--card-bg);
}

/* Suporte para Área Segura e Barra de Navegação Virtual do Android */
@media (max-width: 500px) {
    .app-container {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .bottom-nav {
        height: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        align-items: flex-start !important;
    }
    .nav-item {
        height: 64px !important;
    }
}

/* Gráfico de Notas por Transportadora */
.transp-chart-item {
    margin-bottom: 12px;
}

.transp-chart-item:last-child {
    margin-bottom: 0;
}

.transp-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.transp-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75%;
}

.transp-count {
    color: var(--text-secondary);
}

.transp-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.transp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--primary-blue) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================================
   ESTILOS DE LOGIN E AUTENTICAÇÃO ERP
   ===================================================================== */

.login-view {
    display: none;
    padding: 30px 24px;
    min-height: calc(100vh - 140px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s ease;
}

.login-view.active {
    display: flex;
}

.login-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(238, 242, 246, 0.9);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    font-size: 28px;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.login-logo span {
    color: var(--primary-blue);
}

.login-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.btn-toggle-password:hover {
    color: var(--primary-dark);
    background-color: rgba(15, 30, 54, 0.05);
}

.error-banner {
    background-color: var(--color-danger-bg);
    border-left: 4px solid var(--color-danger);
    color: var(--color-danger);
    font-size: 12px;
    font-weight: 600;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 18px;
    line-height: 1.4;
    animation: shake 0.3s ease-in-out;
}

/* Spinner e Animação de Carregamento */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

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

/* Botão de Logout no Cabeçalho */
.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
    transform: scale(1.05);
}

/* =============================================
   BADGE DE PERFIL (HEADER)
   ============================================= */
.perfil-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid;
    white-space: nowrap;
    line-height: 1;
}
