:root {
    /* Cores principais - Azul Escuro e Amarelo */
    --primary-color: #1a2332;
    --primary-hover: #2c3e50;
    --success-color: #28a745;
    --success-hover: #218838;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --warning-color: #f39c12;
    --warning-hover: #e67e22;
    --info-color: #f1c40f;
    --info-hover: #f39c12;
    
    /* Cores neutras */
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #2c3e50;
    --white: #fffef0;
    --black: #000000;
    
    /* Cores de destaque */
    --accent-yellow: #ffd700;
    --accent-blue: #34495e;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.18);
    
    /* Bordas */
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Transições */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff9e6 !important;
    min-height: 100vh;
    color: #1a2332;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    background: #fffaeb !important;
}

header {
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

header h1 {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.025em;
}

header h1 i {
    color: var(--warning-color);
    font-size: 1.25rem;
}

.header-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.version-info {
    margin-right: 15px;
}

.version-text {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border-radius: var(--border-radius-lg);
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    letter-spacing: 0.025em;
}

.version-text:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.sync-status {
    margin-right: 15px;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sync-indicator.syncing {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.sync-indicator.synced {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.sync-indicator.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.sync-indicator.offline {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.sync-indicator i {
    animation: spin 1s linear infinite;
}

.sync-indicator.synced i {
    animation: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-height: 44px;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    animation: pulse 0.6s ease;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-color));
    border-color: var(--accent-blue);
    box-shadow: 0 6px 20px rgba(26, 35, 50, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), var(--success-hover));
    color: var(--white);
    border-color: var(--success-color);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-hover), #047857);
    border-color: var(--success-hover);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-hover));
    color: var(--white);
    border-color: var(--danger-color);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-hover), #b91c1c);
    border-color: var(--danger-hover);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), var(--warning-hover));
    color: var(--white);
    border-color: var(--warning-color);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-hover), #b45309);
    border-color: var(--warning-hover);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--medium-gray), #4b5563);
    color: var(--white);
    border-color: var(--medium-gray);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    border-color: #4b5563;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* ===== PAINEL ADMINISTRATIVO ===== */

/* Abas do painel administrativo */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.admin-tab-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.admin-tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.admin-tab-content {
    display: none;
    padding: 20px 0;
}

.admin-tab-content.active {
    display: block;
}

/* Seções do painel administrativo */
.admin-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.admin-section h4 {
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Ações do painel administrativo */
.admin-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.settings-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.setting-item {
    background: #fffef8;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #007bff;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: checkbox;
}

/* Checkboxes dinâmicos (readonly inventories) */
.readonly-inventory-checkbox {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    accent-color: #007bff !important;
    margin-right: 12px !important;
}

.setting-description {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 8px 0 0 32px;
    line-height: 1.4;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Grid de status */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.status-item {
    background: #fffef8;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.status-info h5 {
    margin: 0 0 4px 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-value {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Responsividade do painel administrativo */
@media (max-width: 768px) {
    .admin-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .admin-tab-btn {
        border-radius: 8px;
        text-align: center;
        justify-content: center;
    }
    
    .admin-actions,
    .settings-actions,
    .status-actions {
        flex-direction: column;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .status-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .status-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    /* Checkboxes maiores no mobile */
    .setting-item input[type="checkbox"] {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }
    
    .readonly-inventory-checkbox {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        margin-right: 12px !important;
    }
    
    .setting-item label {
        gap: 16px;
        padding: 8px 0;
    }
    
    /* Garantir que checkboxes sejam clicáveis */
    .setting-item label,
    .readonly-inventories-list label {
        min-height: 44px;
        padding: 12px;
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.2);
    }
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.scanner-section, .product-section {
    background: #fffef8;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.scanner-container {
    text-align: center;
}

#scanner {
    width: 100%;
    height: 250px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

#scanner.scanning {
    border-color: #3498db;
    border-style: solid;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
}

#scanner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

#scanner canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Definição removida - estava causando conflito com a sobreposição do scanner */

@keyframes scanPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#scanner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#scanner canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.scanner-placeholder {
    color: #6c757d;
    font-size: 1.1rem;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #3498db;
}

.search-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.product-info, .not-found {
    background: #fffef8;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 24px;
    margin-top: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Garantir que elementos ocultos não ocupem espaço */
.product-info[style*="display: none"],
.product-info[style*="display:none"],
#productInfo[style*="display: none"],
#productInfo[style*="display:none"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.not-found[style*="display: none"],
.not-found[style*="display:none"],
#notFound[style*="display: none"],
#notFound[style*="display:none"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.product-info {
    border-left: 4px solid #3498db;
}

.product-info h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-info h3 i {
    color: #3498db;
}

.product-details .field {
    margin-bottom: 15px;
}

.product-details .field label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.product-details .field span {
    color: #2c3e50;
    font-size: 1.1rem;
}

.product-details .field input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.product-details .field input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Novos estilos para o painel de edição aprimorado */
.product-header {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.readonly-field {
    color: #6c757d;
    font-weight: 500;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: inline-block;
    min-width: 120px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .field {
    flex: 1;
}

.product-details .field input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fffef8;
}

.product-details .field input:invalid {
    border-color: #dc3545;
}

/* Estilos para campos desabilitados no modo contagem */
.product-details .field input:disabled {
    background: #d1d5db !important;
    background-color: #d1d5db !important;
    color: #4b5563 !important;
    cursor: not-allowed !important;
    opacity: 0.8;
    border-color: #9ca3af !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    font-weight: 500;
}

.product-details .field input:disabled::placeholder {
    color: #6b7280;
}

/* Estilo especial para campos editáveis no modo contagem */
.product-details .field input:not(:disabled) {
    background: #fffef8;
    color: #212529;
    border-color: #e9ecef;
}

/* Campo de categoria sempre destacado (editável para todos) */
#productCategory {
    border: 2px solid var(--warning-color) !important;
    background: linear-gradient(135deg, #fff9e6 0%, #fffef8 100%) !important;
    font-weight: 600;
}

#productCategory:focus {
    border-color: var(--warning-color) !important;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15) !important;
    background: #fffef8 !important;
}

#productCategory::placeholder {
    color: #bbb;
    font-style: italic;
    font-weight: normal;
}

/* Destaque visual para campos editáveis no modo contagem */
.product-details .field input:not(:disabled):focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.product-details .actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.product-details .actions .btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-details .actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.not-found {
    text-align: center;
    color: #e74c3c;
}

.not-found i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.inventory-section {
    background: #fffef8;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #fffef8;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

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

.pagination-info {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 16px;
}

/* Controles de paginação */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-size select {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: #fffef8;
}

.pagination-size label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.inventory-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.inventory-section h2 i {
    color: #f39c12;
    margin-right: 10px;
}

.inventory-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 150px;
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.inventory-list {
    max-height: 400px;
    overflow-y: auto;
}

.inventory-item {
    background: var(--white);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.inventory-item:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #d1ecf1;
    animation: pulse 0.8s ease;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 8px;
    font-size: 1.1rem;
    line-height: 1.3;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-barcode {
    color: var(--medium-gray);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 500;
}

.item-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.item-id {
    color: var(--dark-gray);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--light-gray);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #e9ecef;
    box-shadow: var(--shadow-sm);
}

.item-min-stock {
    color: var(--danger-color);
    font-size: 0.8rem;
    font-weight: 600;
    background: #fff5f5;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #fecaca;
    box-shadow: var(--shadow-sm);
}

.item-price {
    color: var(--success-color);
    font-size: 0.8rem;
    font-weight: 700;
    background: #f0fff4;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #bbf7d0;
    box-shadow: var(--shadow-sm);
}

.item-quantity {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--border-radius-lg);
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideInRight {
    from { 
        opacity: 0;
        transform: translateX(400px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

.modal-content {
    background: var(--white);
    margin: 10% auto;
    padding: 40px;
    border-radius: var(--border-radius-xl);
    width: 90%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn var(--transition-normal);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h3 {
    color: var(--dark-gray);
    margin-bottom: 24px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.modal-content p {
    color: var(--medium-gray);
    margin-bottom: 32px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Modal de autenticação */
#authModal .modal-content {
    max-width: 400px;
    text-align: center;
}

#authModal .form-group {
    margin-bottom: 20px;
}

#authModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

#authModal input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

#authModal input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
    animation: pulse 0.3s ease;
}

#authModal .error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: left;
    font-weight: 500;
}

#authModal .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

#authModal .modal-actions .btn {
    min-width: 120px;
}

/* Header do painel administrativo */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.admin-header h3 {
    margin: 0;
    color: #2c3e50;
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background: #e74c3c;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Modal de nome do arquivo */
.filename-input-container {
    display: flex;
    align-items: center;
    margin: 20px 0;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #fffef8;
}

#filenameInput {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.file-extension {
    padding: 12px 15px;
    background: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
    border-left: 1px solid #e9ecef;
}

.filename-suggestions {
    margin: 15px 0;
}

.filename-suggestions p {
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 0.9rem;
}

.suggestion-btn {
    display: inline-block;
    margin: 5px 8px 5px 0;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    color: #495057;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.suggestion-btn:active {
    transform: translateY(0);
    background: #dee2e6;
}

/* Sistema de múltiplos estoques */
.inventory-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.inventory-select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fffef8;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    min-width: 150px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.inventory-select:focus {
    outline: none;
    border-color: #3498db;
}

.btn-outline {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Modal de cadastro de produto */
.large-modal {
    max-width: 800px;
    width: 95%;
    margin: 5% auto;
    max-height: 90vh;
    overflow-y: auto;
}

.product-form {
    margin: 20px 0;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    flex: 1 1 100%;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #fffef8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Botão de escanear no formulário */
.form-group .btn-outline {
    margin-top: 5px;
    align-self: flex-start;
}

.barcode-input-group {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.barcode-input-group input {
    flex: 1;
}

.barcode-input-group .btn {
    margin-top: 0;
    white-space: nowrap;
}

/* Garantir que os botões do modal de cadastro sejam visíveis */
.large-modal .modal-actions {
    position: sticky;
    bottom: 0;
    background: #fffef8;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #e9ecef;
    z-index: 10;
}

/* Lista de estoques */
.inventory-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.inventory-item-header h4 {
    margin: 0;
    color: #495057;
}

.inventories-list {
    max-height: 300px;
    overflow-y: auto;
}

.inventory-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    background: #fffef8;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.inventory-item-card:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #d1ecf1;
}

.inventory-item-card.active {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.inventory-info h5 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 1rem;
}

.inventory-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.85rem;
}

.inventory-actions {
    display: flex;
    gap: 8px;
}

.inventory-actions .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Responsividade para novos componentes */
@media (max-width: 768px) {
    .inventory-selector {
        margin-right: 10px;
    }
    
    .inventory-select {
        min-width: 120px;
        font-size: 0.8rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .inventory-item-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .inventory-item-card {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .inventory-actions {
        justify-content: center;
    }
    
    /* Responsividade para modal de cadastro */
    .large-modal {
        margin: 2% auto;
        max-height: 95vh;
        padding: 20px;
        width: 98%;
    }
    
    .large-modal .modal-actions {
        position: sticky;
        bottom: 0;
        background: #fffef8;
        padding: 20px 0;
        margin-top: 20px;
        border-top: 2px solid #e9ecef;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .large-modal .modal-actions .btn {
        width: 100%;
        padding: 16px;
        font-size: 1rem;
        border-radius: 10px;
        margin: 4px 0;
    }
    
    .large-modal .product-form {
        margin: 16px 0;
        max-height: 60vh;
        overflow-y: auto;
        padding-right: 8px;
    }
    
    .large-modal .form-row {
        margin-bottom: 16px;
    }
    
    .large-modal .form-group {
        margin-bottom: 12px;
    }
    
    .large-modal .form-group label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 6px;
    }
    
    .large-modal .barcode-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .large-modal .barcode-input-group .btn {
        width: 100%;
        margin-top: 0;
    }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 20px 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    transform: translateX(400px);
    transition: all var(--transition-normal);
    z-index: 1500;
    max-width: 400px;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: slideInRight 0.4s ease;
}

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

.toast.success {
    background: linear-gradient(135deg, var(--success-color), #2ecc71);
    border-left-color: #1e8449;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    border-left-color: #a93226;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
}

.toast.warning {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    border-left-color: #d68910;
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3);
}

.toast.info {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-left-color: #2471a3;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

/* ===== RESPONSIVIDADE MOBILE COMPLETA ===== */
@media (max-width: 768px) {
    /* Reset e configurações base */
    * {
        box-sizing: border-box;
    }
    
    /* Melhorar espaçamento geral */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Container principal */
    .container {
        padding: 0;
        margin: 0;
        min-height: 100vh;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Header mobile otimizado */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: var(--white);
        box-shadow: var(--shadow-md);
        padding: 20px 24px;
        margin: 0;
        border-bottom: 1px solid #e9ecef;
        backdrop-filter: blur(10px);
    }
    
    header h1 {
        font-size: 1.5rem;
        text-align: center;
        margin: 0 0 16px 0;
        color: var(--dark-gray);
        font-weight: 700;
        letter-spacing: -0.025em;
    }
    
    /* Header actions - layout flexível */
    .header-actions {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
    
    .inventory-selector {
        display: flex;
        gap: 8px;
        width: 100%;
        margin: 0;
    }
    
    .inventory-select {
        flex: 1;
        min-width: 0;
        padding: 12px 16px;
        border-radius: 10px;
        font-size: 16px; /* Previne zoom iOS */
        border: 2px solid #e9ecef;
        background: #fffef8;
    }
    
    /* Botões do header */
    .header-actions .btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 16px; /* Previne zoom iOS */
        border-radius: var(--border-radius-md);
        margin: 0;
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        font-weight: 700;
        box-shadow: var(--shadow-sm);
        transition: all var(--transition-normal);
    }
    
    /* Versão e status */
    .version-info {
        text-align: center;
        margin: 8px 0 0 0;
    }
    
    .sync-status {
        text-align: center;
        margin: 4px 0 0 0;
    }
    
    /* Main content - sem padding para usar toda tela */
    .main-content {
        padding: 16px;
        gap: 20px;
        min-height: calc(100vh - 140px);
        overflow-x: hidden;
    }
    
    /* Seções principais */
    .scanner-section, 
    .product-section, 
    .inventory-section {
        background: #fffef8;
        border-radius: 16px;
        padding: 20px;
        margin: 0 0 20px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border: 1px solid #f1f5f9;
        width: 100%;
        overflow: hidden;
    }
    
    /* Scanner */
    #scanner {
        width: 100%;
        height: 220px;
        border-radius: 12px;
        margin-bottom: 16px;
        overflow: hidden;
    }
    
    .scanner-controls {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .scanner-controls .btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 52px;
    }
    
    /* Stats grid */
    .inventory-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }
    
    /* Tabs */
    .inventory-tabs {
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0;
    }
    
    .tabs {
        display: flex;
        gap: 8px;
        min-width: max-content;
        padding: 0 4px;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 48px;
        flex-shrink: 0;
    }
    
    /* Items da lista */
    .inventory-item {
        background: #fffef8;
        border: 1px solid #e9ecef;
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        width: 100%;
        overflow: hidden;
    }
    
    .item-name {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 8px;
        color: #2c3e50;
        line-height: 1.3;
    }
    
    .item-details {
        gap: 6px;
    }
    
    .item-barcode {
        font-size: 0.9rem;
        color: #6c757d;
        margin-bottom: 8px;
        word-break: break-all;
    }
    
    .item-meta {
        gap: 8px;
        margin-top: 6px;
    }
    
    .item-id, .item-min-stock, .item-price {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    /* Responsividade para painel de edição */
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .product-details .actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-details .actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    .product-header {
        padding: 10px 12px;
        margin-bottom: 16px;
    }
    
    .readonly-field {
        min-width: auto;
        width: 100%;
        text-align: center;
    }
    
    .item-quantity {
        padding: 8px 12px;
        font-size: 1rem;
        min-width: 60px;
        text-align: center;
        border-radius: 8px;
        font-weight: 600;
    }
    
    /* Paginação */
    .pagination-controls {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;
        margin-top: 24px;
        padding: 20px 0;
    }
    
    .pagination {
        order: 2;
        display: flex;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-size {
        order: 1;
    }
    
    .pagination-btn {
        min-width: 44px;
        height: 44px;
        font-size: 16px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Modais */
    .modal-content {
        margin: 5% auto;
        padding: 24px;
        width: 95%;
        max-width: none;
        border-radius: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
        padding-top: 20px;
        border-top: 1px solid #e9ecef;
    }
    
    .modal-actions .btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 52px;
    }
    
    /* Inputs e formulários */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Previne zoom iOS */
        padding: 14px 16px;
        border-radius: 12px;
        border: 2px solid #e9ecef;
        width: 100%;
        margin: 0;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    /* Toast notifications */
    .toast {
        top: 20px;
        right: 16px;
        left: 16px;
        transform: translateY(-120px);
        max-width: none;
        padding: 16px 20px;
        border-radius: 12px;
        font-size: 14px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        z-index: 2000;
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    /* Espaçamento para botão flutuante */
    .main-content {
        padding-bottom: 100px;
    }
    
    /* Garantir que nada seja cortado */
    .scanner-section,
    .product-section,
    .inventory-section {
        margin-bottom: 24px;
        padding-bottom: 24px;
    }
    
    /* Melhorar visibilidade dos botões */
    .btn {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        font-weight: 600;
    }
    
    .btn-success {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }
    
    .btn-secondary {
        box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
    }
    
    .btn-warning {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }
    
    .btn-danger {
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 12px 14px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .main-content {
        padding: 12px;
        padding-bottom: 70px; /* Espaço para botão flutuante */
    }
    
    .scanner-section, .product-section, .inventory-section {
        padding: 12px;
        border-radius: 10px;
        margin-bottom: 12px;
    }
    
    #scanner {
        height: 180px;
        border-radius: 8px;
    }
    
    .inventory-item {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    .modal-content {
        margin: 3% auto;
        padding: 16px;
        width: 98%;
        max-height: 95vh;
    }
    
    .modal-actions {
        padding: 16px 0;
        gap: 8px;
    }
    
    .modal-actions .btn {
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    .inventory-item-card {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .inventory-actions .btn {
        min-width: 100px;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .pagination {
        padding: 12px 0;
        gap: 4px;
    }
    
    /* Garantir que elementos não sejam cortados em telas muito pequenas */
    .inventory-section,
    .scanner-section,
    .product-section {
        padding-bottom: 0 !important;
        min-height: auto;
    }
    
    /* Remover espaço quando não há produto sendo editado no mobile */
    .product-section:has(#productInfo[style*="display: none"]):has(#notFound[style*="display: none"]) {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Garantir que elementos ocultos não ocupem espaço no mobile */
    #productInfo[style*="display: none"],
    #productInfo[style*="display:none"],
    #notFound[style*="display: none"],
    #notFound[style*="display:none"] {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .product-info[style*="display: none"],
    .product-info[style*="display:none"],
    #productInfo[style*="display: none"],
    #productInfo[style*="display:none"] {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        border: none !important;
    }
    
    .not-found[style*="display: none"],
    .not-found[style*="display:none"],
    #notFound[style*="display: none"],
    #notFound[style*="display:none"] {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Melhorar contraste dos botões */
    .btn-success {
        background: #10b981;
        box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
    }
    
    .btn-secondary {
        background: #6b7280;
        box-shadow: 0 3px 10px rgba(107, 114, 128, 0.4);
    }
    
    .btn-primary {
        box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
    }
    
    .sync-indicator {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.inventory-item {
    animation: slideUp 0.4s ease;
}

/* Scrollbar personalizada */
.inventory-list::-webkit-scrollbar {
    width: 8px;
}

.inventory-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.inventory-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.inventory-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Abas do inventário */
.inventory-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

/* Produtos sem código de barras */
.inventory-item.no-barcode {
    border-left: 4px solid #f39c12;
}

.inventory-item.no-barcode .item-barcode {
    color: #f39c12;
    font-style: italic;
}

/* Produtos atualizados */
.inventory-item.updated {
    border-left: 4px solid #27ae60;
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.1), transparent);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.updated-badge {
    display: inline-block;
    background: #27ae60;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

.updated-badge i {
    margin-right: 3px;
}

.updated-by-user {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form label {
    font-weight: 600;
    color: #495057;
}

.login-form input {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fcc;
    font-size: 0.9rem;
}

#loginModal {
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

#usernameModal {
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

/* Bloquear rolagem do body quando modal estiver aberto */
body.body-scroll-locked {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Campo de código de barras editável */
.product-details .field input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fffef8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-details .field input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Botão próximo item */
#nextBtn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

/* Indicador de tipo de código */
.code-type {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

.code-type.barcode {
    background: #d4edda;
    color: #155724;
}

.code-type.internal {
    background: #fff3cd;
    color: #856404;
}

.code-type.generated {
    display: none; /* Ocultar tag "Gerado" */
}

/* Botão de simulação */
.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Botão flutuante de câmera */
.floating-camera-btn {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4) !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    transition: all 0.3s ease !important;
    animation: pulse 2s infinite !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.floating-camera-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.6);
}

.floating-camera-btn:active {
    transform: scale(0.95);
}

.floating-camera-btn i {
    pointer-events: none;
}

/* Animação de pulso para o botão flutuante */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.8);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
    }
}

/* Responsividade para o botão flutuante */
@media (max-width: 768px) {
    .floating-camera-btn {
        width: 55px !important;
        height: 55px !important;
        bottom: 15px !important;
        right: 15px !important;
        font-size: 22px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1000 !important;
        position: fixed !important;
    }
}

@media (max-width: 480px) {
    .floating-camera-btn {
        width: 50px !important;
        height: 50px !important;
        bottom: 10px !important;
        right: 10px !important;
        font-size: 20px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1000 !important;
        position: fixed !important;
    }
}

/* Correção específica para dispositivos móveis */
@media screen and (max-width: 768px) {
    .floating-camera-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        z-index: 1000 !important;
        width: 55px !important;
        height: 55px !important;
        bottom: 15px !important;
        right: 15px !important;
        font-size: 22px !important;
        background: linear-gradient(135deg, #007bff, #0056b3) !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4) !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
        animation: pulse 2s infinite !important;
    }
}

@media screen and (max-width: 480px) {
    .floating-camera-btn {
        width: 50px !important;
        height: 50px !important;
        bottom: 10px !important;
        right: 10px !important;
        font-size: 20px !important;
    }
}

/* ===== CORREÇÕES ESPECÍFICAS PARA MOBILE ===== */

/* Garantir que nenhum elemento seja cortado */
@media (max-width: 768px) {
    /* Corrigir problemas de viewport */
    .container {
        min-height: 100vh;
        padding-bottom: 120px; /* Espaço extra para botões flutuantes */
    }
    
    /* Corrigir header que pode ser cortado */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Corrigir modais que podem sair da tela */
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 2000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        position: relative;
        margin: 20px auto;
        max-width: calc(100vw - 40px);
        width: calc(100vw - 40px);
        box-sizing: border-box;
    }
    
    /* Corrigir formulários que podem ser cortados */
    .large-modal {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .large-modal .product-form {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 8px;
        margin-right: -8px;
    }
    
    /* Corrigir tabs que podem ser cortados */
    .tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    /* Corrigir paginação que pode ser cortada */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        padding: 16px 0;
    }
    
    /* Corrigir botões que podem ser muito pequenos */
    .btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Corrigir inputs que podem causar zoom no iOS */
    input, select, textarea {
        font-size: 16px !important;
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    /* Corrigir lista de inventário */
    .inventory-list {
        max-height: none;
        overflow: visible;
    }
    
    /* Corrigir cards de inventário */
    .inventory-item {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Corrigir botão flutuante */
    .floating-camera-btn {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        z-index: 1500 !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4) !important;
    }
    
    /* Corrigir toast que pode ser cortado */
    .toast {
        position: fixed;
        top: 20px;
        left: 16px;
        right: 16px;
        z-index: 3000;
        max-width: none;
        width: auto;
    }
    
    /* Corrigir stats que podem quebrar */
    .inventory-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
    }
    
    /* Corrigir selector de inventário */
    .inventory-selector {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .inventory-select {
        width: 100%;
        min-width: 0;
    }
    
    /* Corrigir ações do header */
    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .header-actions .btn {
        width: 100%;
        min-width: 0;
    }
    
    /* Corrigir controles do scanner */
    .scanner-controls {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .scanner-controls .btn {
        width: 100%;
        min-width: 0;
    }
    
    /* Corrigir controles de paginação */
    .pagination-controls {
        width: 100%;
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
    
    .pagination-size {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    /* Corrigir ações dos modais */
    .modal-actions {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-actions .btn {
        width: 100%;
        min-width: 0;
    }
    
    /* Corrigir grupos de formulário */
    .form-group {
        width: 100%;
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Corrigir grupos de input de código de barras */
    .barcode-input-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .barcode-input-group input {
        width: 100%;
    }
    
    .barcode-input-group .btn {
        width: 100%;
    }
    
    /* Corrigir cards de inventário em modais */
    .inventory-item-card {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    .inventory-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .inventory-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

/* Correções específicas para telas muito pequenas */
@media (max-width: 480px) {
    /* Aumentar espaçamento para evitar cortes */
    .container {
        padding-bottom: 140px;
    }
    
    /* Reduzir padding do header */
    header {
        padding: 12px 16px;
    }
    
    /* Ajustar modais para telas pequenas */
    .modal-content {
        margin: 10px auto;
        max-width: calc(100vw - 20px);
        width: calc(100vw - 20px);
        padding: 16px;
    }
    
    /* Modal de autenticação responsivo */
    #authModal .modal-content {
        max-width: calc(100vw - 20px);
        width: calc(100vw - 20px);
        margin: 20px auto;
    }
    
    #authModal .modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    #authModal .modal-actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    /* Header do painel admin responsivo */
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .admin-header h3 {
        font-size: 1.3rem;
    }
    
    .btn-outline-danger {
        width: 100%;
        max-width: 200px;
    }
    
    /* Ajustar botão flutuante para telas pequenas */
    .floating-camera-btn {
        bottom: 15px !important;
        right: 15px !important;
        width: 55px !important;
        height: 55px !important;
    }
    
    /* Ajustar toast para telas pequenas */
    .toast {
        top: 16px;
        left: 12px;
        right: 12px;
    }
    
    /* Ajustar scanner para telas pequenas */
    #scanner {
        height: 160px;
    }
    
    /* Ajustar items para telas pequenas */
    .inventory-item {
        padding: 14px;
    }
    
    /* Ajustar tabs para telas pequenas */
    .tab-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    /* Ajustar botões para telas pequenas */
    .btn {
        padding: 12px 16px;
        font-size: 15px;
        min-height: 44px;
    }
    
    /* Ajustar paginação para telas pequenas */
    .pagination-btn {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    /* Ajustar inputs para telas pequenas */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 16px;
    }
}

/* Scanner Overlay - Estilos inline no HTML para máxima compatibilidade */

/* ===== BOTÃO ESTOQUE MÍNIMO ===== */

#estoqueMinimoBtnLink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--info-color) 100%);
    color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    margin-left: 8px;
}

#estoqueMinimoBtnLink:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--info-color) 0%, var(--accent-yellow) 100%);
}

#estoqueMinimoBtnLink i {
    font-size: 16px;
}

/* Responsivo para mobile */
@media (max-width: 768px) {
    #estoqueMinimoBtnLink {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    #estoqueMinimoBtnLink span {
        display: none; /* Esconder texto no mobile, mostrar só ícone */
    }
    
    #estoqueMinimoBtnLink i {
        margin: 0;
    }
}

/* ===== ESTILOS DE GERENCIAMENTO DE USUÁRIOS ===== */

.users-list-container {
    margin-top: 20px;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: #fffef8;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.users-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.users-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color var(--transition-fast);
}

.users-table tbody tr:hover {
    background-color: #f7fafc;
}

.users-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: #4a5568;
}

.users-table tbody td:first-child {
    font-weight: 600;
    color: #2d3748;
}

.user-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-type-badge.admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-type-badge.user {
    background: #e2e8f0;
    color: #4a5568;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions .btn-small {
    padding: 6px 12px;
    font-size: 12px;
    min-height: auto;
}

.register-link a {
    transition: all var(--transition-fast);
}

.register-link a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

.error-message {
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: var(--border-radius-sm);
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 12px;
}
