/* ===== SISTEMA DE DESIGN - CONVENIENCIAS V3.0 ===== */

/* Importar fontes do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

:root {
    /* Paleta de Cores Roxo Escuro */
    --primary: #6d28d9;
    --primaryLight: #7c3aed;
    --primaryDark: #5b21b6;
    --primaryGlow: rgba(109, 40, 217, 0.15);
    
    --secondary: #6d28d9;
    --secondaryLight: #7c3aed;
    --secondaryDark: #5b21b6;
    
    --accent: #6d28d9;
    --accentLight: #7c3aed;
    --accentDark: #5b21b6;
    
    /* Cores de Status */
    --success: #059669;
    --successLight: #d1fae5;
    --successGlow: rgba(5, 150, 105, 0.15);
    
    --danger: #dc2626;
    --dangerLight: #fee2e2;
    --dangerGlow: rgba(220, 38, 38, 0.15);
    
    --warning: #d97706;
    --warningLight: #fef3c7;
    --warningGlow: rgba(217, 119, 6, 0.15);
    
    --info: #6d28d9;
    --infoLight: #ede9fe;
    --infoGlow: rgba(109, 40, 217, 0.15);
    
    /* Neutros Refinados */
    --white: #ffffff;
    --gray50: #f8fafc;
    --gray100: #f1f5f9;
    --gray200: #e2e8f0;
    --gray300: #cbd5e1;
    --gray400: #94a3b8;
    --gray500: #64748b;
    --gray600: #475569;
    --gray700: #334155;
    --gray800: #1e293b;
    --gray900: #0f172a;
    
    /* Backgrounds */
    --bgPage: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%);
    --bgCard: #ffffff;
    --bgCardHover: #faf5ff;
    --bgSection: #faf5ff;
    
    /* Sombras Premium */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 40px rgba(109, 40, 217, 0.15);
    
    /* Bordas */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;
    
    /* Transições */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET E BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bgPage);
    min-height: 100vh;
    color: var(--gray800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
}

/* ===== HEADER PREMIUM ===== */
header {
    position: relative;
    z-index: 100;
    background: linear-gradient(135deg, var(--primaryDark) 0%, var(--primary) 50%, var(--primaryDark) 100%);
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    box-shadow: 0 4px 24px rgba(109, 40, 217, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primaryLight) 0%, var(--primary) 50%, var(--primaryLight) 100%);
}

header h1 {
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

header h1 i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.4rem;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}

.inventory-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-select {
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray800);
    min-width: 120px;
    max-width: 200px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.inventory-select:focus {
    outline: none;
    border-color: var(--white);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
    background: var(--white);
}

.version-info {
    margin-left: 8px;
}

.version-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: var(--gray900);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sync-status {
    margin-left: 8px;
}

.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
    backdrop-filter: blur(8px);
}

.sync-indicator.syncing {
    background: rgba(255, 255, 255, 0.9);
    color: var(--info);
}

.sync-indicator.synced {
    background: rgba(255, 255, 255, 0.9);
    color: var(--success);
}

.sync-indicator.error {
    background: rgba(255, 255, 255, 0.9);
    color: var(--danger);
}

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

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

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

/* ===== BOTÕES PREMIUM ===== */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 44px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    font-family: inherit;
    border: 2px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primaryGlow), var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primaryLight) 100%);
    color: var(--white);
    border-color: var(--primaryDark);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.5);
    border-width: 2px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primaryDark) 0%, var(--primary) 100%);
    box-shadow: 0 6px 16px rgba(109, 40, 217, 0.6);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #10b981 100%);
    color: var(--white);
    border-color: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, var(--success) 100%);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.5);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
    color: var(--white);
    border-color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, var(--danger) 100%);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
    color: var(--white);
    border-color: #b45309;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #b45309 0%, var(--warning) 100%);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.5);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    color: var(--primaryDark);
    border-color: rgba(255, 255, 255, 1);
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5);
    font-weight: 700;
}

.btn-info:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 1);
    color: var(--primary);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray500) 0%, var(--gray600) 100%);
    color: var(--white);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--gray600) 0%, var(--gray700) 100%);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-outline-danger {
    background: var(--white);
    border: 2px solid var(--danger);
    color: var(--danger);
}

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

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

.btn-sm, .btn-small {
    padding: 8px 14px;
    font-size: 0.8rem;
    min-height: 36px;
}

/* ===== LAYOUT PRINCIPAL ===== */
.main-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 28px;
    padding: 28px;
}

.product-section, .inventory-section {
    background: var(--bgCard);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray200);
}

/* ===== BARRA DE BUSCA ===== */
.search-container {
    position: relative;
    margin-bottom: 24px;
}

#searchInput {
    width: 100%;
    padding: 14px 48px 14px 18px;
    border: 2px solid var(--gray200);
    border-radius: var(--radius-lg);
    font-size: 16px;
    transition: all var(--transition);
    font-family: inherit;
    background: var(--gray50);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primaryGlow);
    background: var(--white);
}

#searchInput::placeholder {
    color: var(--gray400);
}

.search-container i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray400);
    font-size: 1.1rem;
}

/* ===== CARD DE EDIÇÃO DE PRODUTO ===== */
.product-info {
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: var(--radius-xl);
    padding: 0;
    margin-top: 20px;
    box-shadow: var(--shadow-lg), 0 0 0 4px var(--primaryGlow);
    overflow: hidden;
}

.product-info h3 {
    color: var(--white);
    margin: 0;
    padding: 18px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primaryLight) 100%);
}

.product-info h3 i {
    color: rgba(255, 255, 255, 0.9);
}

.product-details {
    padding: 24px;
}

.product-header {
    background: var(--gray50);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--gray200);
}

.readonly-field {
    color: var(--gray600);
    font-weight: 600;
    background: var(--white);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray200);
    display: inline-block;
    min-width: 120px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

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

.product-details .field label {
    display: block;
    font-weight: 600;
    color: var(--gray700);
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-details .field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--white);
    font-family: inherit;
}

.product-details .field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primaryGlow);
}

.product-details .field input:disabled {
    background: var(--gray100);
    color: var(--gray500);
    cursor: not-allowed;
    border-color: var(--gray200);
}

.product-details .actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--gray100);
    flex-wrap: wrap;
}

.product-details .actions .btn {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 100%;
}

/* ===== MENSAGEM NÃO ENCONTRADO ===== */
.not-found {
    background: linear-gradient(135deg, var(--dangerLight) 0%, #fff5f5 100%);
    border: 2px dashed var(--danger);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    margin-top: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.not-found i {
    font-size: 3.5rem;
    color: var(--danger);
    margin-bottom: 16px;
    display: block;
}

.not-found p {
    color: var(--danger);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

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

/* ===== SEÇÃO DE INVENTÁRIO ===== */
.inventory-section h2 {
    color: var(--gray900);
    margin-bottom: 24px;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--primaryGlow) 0%, var(--infoLight) 100%);
    border-radius: var(--radius-lg);
    border-left: 5px solid var(--primary);
}

.inventory-section h2 i {
    color: var(--primary);
    font-size: 1.5rem;
}

.inventory-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: linear-gradient(145deg, var(--primary) 0%, var(--primaryLight) 100%);
    color: var(--white);
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
}

.stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
    position: relative;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.9;
    position: relative;
}

/* ===== ABAS DE NAVEGAÇÃO ===== */
.inventory-tabs {
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 6px;
    background: var(--gray100);
    padding: 6px;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--gray600);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition);
    font-family: inherit;
    text-align: center;
    position: relative;
}

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

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* ===== LISTA DE INVENTÁRIO ===== */
.inventory-list {
    max-height: 500px;
    overflow-y: auto;
    background: var(--gray50);
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray200);
}

.inventory-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--gray200);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
    cursor: pointer;
}

.inventory-item:hover {
    background: var(--primaryGlow);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

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

.inventory-item.updated {
    background: linear-gradient(135deg, var(--successLight) 0%, #ecfdf5 100%);
    border-left: 4px solid var(--success);
}

.inventory-item.estoque-baixo {
    background: linear-gradient(135deg, var(--dangerLight) 0%, #fef2f2 100%);
    border-left: 4px solid var(--danger);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray900);
    margin-bottom: 8px;
    line-height: 1.4;
}

.updated-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--success);
    color: var(--white);
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.updated-by-user {
    font-size: 0.75rem;
    color: var(--gray500);
    margin-top: 6px;
    font-style: italic;
}

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

.item-id, .item-min-stock, .item-price {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.item-id {
    background: var(--infoLight);
    color: var(--info);
}

.item-min-stock {
    background: var(--warningLight);
    color: var(--warning);
}

.item-price {
    background: var(--successLight);
    color: var(--success);
}

.item-barcode {
    font-family: 'JetBrains Mono', monospace;
    color: var(--gray400);
    font-size: 0.7rem;
    margin-top: 6px;
}

.item-category {
    background: var(--accent);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-full);
    padding: 3px 10px;
    margin-top: 6px;
    display: inline-block;
}

.item-quantity {
    min-width: 56px;
    height: 56px;
    background: linear-gradient(145deg, var(--primary), var(--primaryLight));
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 800;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.inventory-item.estoque-baixo .item-quantity {
    background: linear-gradient(145deg, var(--danger), #ef4444);
}

.inventory-item.updated .item-quantity {
    background: linear-gradient(145deg, var(--success), #10b981);
}

/* ===== PAGINAÇÃO ===== */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    background: var(--gray50);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    border: 1px solid var(--gray200);
}

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

.pagination-size label {
    font-size: 0.85rem;
    color: var(--gray600);
    font-weight: 500;
}

.pagination-size select {
    padding: 8px 12px;
    border: 1px solid var(--gray300);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    background: var(--white);
    font-family: inherit;
    cursor: pointer;
}

.pagination {
    display: flex;
    gap: 6px;
}

.pagination-btn {
    min-width: 38px;
    height: 38px;
    padding: 8px;
    border: 1px solid var(--gray300);
    background: var(--white);
    color: var(--gray600);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

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

/* ===== MODAIS PREMIUM ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.modal-content {
    background: var(--white);
    margin: 0 auto;
    padding: 0;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.35s ease;
    position: relative;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content.large-modal {
    max-width: 900px;
    max-height: calc(100vh - 48px);
}

.modal-content h3 {
    color: var(--white);
    margin: 0;
    padding: 18px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primaryLight) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.modal-content h3 i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.modal-content p {
    color: var(--gray600);
    padding: 20px 24px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--gray200);
    flex-wrap: wrap;
    background: var(--gray50);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Botão de fechar modal (X) */
.btn-close-modal {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* Corpo do modal com scroll */
.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    -webkit-overflow-scrolling: touch;
}

.modal-body-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-body-scroll::-webkit-scrollbar-track {
    background: var(--gray100);
    border-radius: var(--radius-full);
}

.modal-body-scroll::-webkit-scrollbar-thumb {
    background: var(--gray300);
    border-radius: var(--radius-full);
}

.modal-body-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--gray400);
}

/* Header de item no inventário */
.inventory-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--gray100);
}

.inventory-item-header h4 {
    margin: 0;
    color: var(--gray800);
    font-size: 1rem;
    font-weight: 700;
}

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

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray700);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--white);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primaryGlow);
}

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

.barcode-input-group {
    display: flex;
    gap: 10px;
}

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

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--gray900);
    color: var(--white);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 380px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.toast.success { background: linear-gradient(135deg, var(--success), #10b981); }
.toast.error { background: linear-gradient(135deg, var(--danger), #ef4444); }
.toast.warning { background: linear-gradient(135deg, var(--warning), #f59e0b); }
.toast.info { background: linear-gradient(135deg, var(--info), var(--secondaryLight)); }

/* ===== BOTÃO FLUTUANTE ===== */
.floating-camera-btn {
    position: fixed !important;
    bottom: 28px !important;
    right: 28px !important;
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
    color: var(--white) !important;
    border: none !important;
    box-shadow: 0 6px 24px rgba(109, 40, 217, 0.4) !important;
    cursor: pointer !important;
    z-index: 999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 26px !important;
    transition: all 0.3s ease !important;
    animation: pulse-glow 2s infinite !important;
}

.floating-camera-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 32px rgba(109, 40, 217, 0.5) !important;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 6px 24px rgba(109, 40, 217, 0.4); }
    50% { box-shadow: 0 6px 32px rgba(109, 40, 217, 0.6); }
}

/* ===== PAINEL ADMINISTRATIVO ===== */
#adminPanelModal .modal-content {
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

#adminPanelModal .modal-content > *:not(.admin-header):not(.modal-actions) {
    overflow-y: auto;
    flex: 1;
    padding: 0 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primaryLight) 100%);
    margin: 0;
    border-radius: 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-header h3 {
    margin: 0;
    padding: 0;
    background: none;
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header h3 i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.admin-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 20px 24px;
    background: linear-gradient(135deg, var(--gray100) 0%, var(--gray50) 100%);
    padding: 10px;
    border-radius: var(--radius-xl);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    border: 1px solid var(--gray200);
}

.admin-tab-btn {
    padding: 14px 12px;
    border: 2px solid transparent;
    background: transparent;
    color: var(--gray500);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-align: center;
    line-height: 1.3;
    position: relative;
}

.admin-tab-btn:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--gray200);
    transform: translateY(-2px);
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primaryLight) 100%);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
    transform: translateY(-2px);
}

.admin-tab-btn.active i {
    color: var(--white);
}

.admin-tab-btn i {
    font-size: 1.3rem;
    color: var(--gray400);
    transition: all var(--transition);
}

.admin-tab-btn:hover i {
    color: var(--primary);
}

.admin-tab-btn span {
    display: block;
}

.admin-tab-content {
    display: none;
    animation: slideIn 0.35s ease;
    padding: 0 24px 24px;
}

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

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

.admin-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--gray200);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

.admin-section:hover {
    box-shadow: var(--shadow-lg);
}

.admin-section h4 {
    color: var(--gray900);
    margin-bottom: 18px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--primaryGlow);
    position: relative;
}

.admin-section h4::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primaryLight));
    border-radius: var(--radius-full);
}

.admin-section h4 i {
    color: var(--white);
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primaryLight));
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.admin-description {
    color: var(--gray600);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.6;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--infoLight) 0%, var(--gray50) 100%);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-xs);
}

/* Footer do modal admin */
.admin-modal-footer {
    margin-top: auto;
    justify-content: space-between;
}

.admin-modal-footer .btn {
    flex: 1;
    max-width: 200px;
}

.settings-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.setting-item {
    background: var(--white);
    border: 2px solid var(--gray200);
    border-radius: var(--radius-xl);
    padding: 20px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.setting-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gray300);
    transition: all var(--transition);
}

.setting-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.setting-item:hover::before {
    background: var(--primary);
}

.setting-item:has(input:checked)::before {
    background: var(--success);
}

.setting-item:has(input:checked) {
    background: linear-gradient(135deg, var(--successLight) 0%, var(--white) 100%);
    border-color: var(--success);
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-weight: 700;
    color: var(--gray800);
    font-size: 1rem;
}

.setting-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.setting-description {
    color: var(--gray500);
    font-size: 0.85rem;
    margin: 12px 0 0 40px;
    line-height: 1.6;
    padding: 10px 14px;
    background: var(--gray50);
    border-radius: var(--radius-md);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.status-item {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray50) 100%);
    border: 2px solid var(--gray200);
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.status-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at top right, var(--primaryGlow) 0%, transparent 70%);
    pointer-events: none;
}

.status-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.status-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, var(--primary), var(--primaryLight));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
    flex-shrink: 0;
}

.status-info {
    flex: 1;
    min-width: 0;
}

.status-info h5 {
    margin: 0 0 6px;
    color: var(--gray800);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-value {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 800;
    display: block;
}

.admin-actions,
.settings-actions,
.status-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 2px solid var(--gray100);
    flex-wrap: wrap;
}

.admin-actions .btn,
.settings-actions .btn,
.status-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* ===== LOGIN ===== */
.login-form {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form label {
    font-weight: 600;
    color: var(--gray700);
}

.login-form input {
    padding: 14px 16px;
    font-size: 1rem;
}

.error-message {
    background: var(--dangerLight);
    color: var(--danger);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--danger);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== SCROLL LOCK ===== */
body.body-scroll-locked {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* ===== SCROLLBAR ===== */
.inventory-list::-webkit-scrollbar {
    width: 8px;
}

.inventory-list::-webkit-scrollbar-track {
    background: var(--gray100);
    border-radius: var(--radius-full);
}

.inventory-list::-webkit-scrollbar-thumb {
    background: var(--gray300);
    border-radius: var(--radius-full);
}

.inventory-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray400);
}

/* ===== RESPONSIVIDADE DESKTOP ===== */
@media (min-width: 1200px) {
    .main-content {
        gap: 36px;
        padding: 36px;
    }
    
    .inventory-stats {
        gap: 20px;
    }
    
    .stat {
        padding: 24px 20px;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
}

/* ===== RESPONSIVIDADE TABLET ===== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .inventory-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== RESPONSIVIDADE DESKTOP GRANDE ===== */
@media (min-width: 1200px) {
    header {
        padding: 18px 28px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .header-actions .btn span {
        display: inline;
    }
    
    .inventory-select {
        min-width: 180px;
    }
}

/* ===== RESPONSIVIDADE TABLET ===== */
@media (max-width: 1024px) {
    header {
        padding: 14px 16px;
    }
    
    header h1 {
        font-size: 1.15rem;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .btn i {
        font-size: 0.9rem;
    }
    
    /* Esconder texto em tablets médios, manter apenas ícones */
    .header-actions .btn span {
        display: none;
    }
    
    .header-actions .btn {
        padding: 10px 12px;
        min-width: 44px;
    }
    
    .inventory-select {
        min-width: 100px;
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}

/* ===== RESPONSIVIDADE MOBILE ===== */
@media (max-width: 768px) {
    header {
        padding: 12px;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        gap: 10px;
        flex-direction: column;
    }
    
    header h1 {
        font-size: 1.05rem;
        width: 100%;
        justify-content: center;
        order: -1;
    }
    
    .header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
        align-items: center;
    }
    
    .header-actions > *:not(.inventory-selector):not(.version-info):not(.sync-status) {
        flex: 0 1 auto;
        min-width: 0;
    }
    
    .header-actions .btn {
        flex: 0 1 auto;
        min-width: 100px;
        max-width: 100%;
        padding: 10px 8px;
        font-size: 0.75rem;
        min-height: 44px;
        justify-content: center;
    }
    
    .header-actions .btn span {
        display: inline;
        font-size: 0.7rem;
    }
    
    .header-actions .btn i {
        font-size: 0.85rem;
    }
    
    .inventory-selector {
        flex: 1 1 100%;
        order: -1;
        display: flex;
        gap: 8px;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .version-info, .sync-status {
        display: none;
    }
    
    .inventory-select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    
    .inventory-selector .btn {
        flex-shrink: 0;
        width: auto;
        min-width: 44px;
        padding: 10px;
    }
    
    .main-content {
        padding: 12px;
        gap: 12px;
    }
    
    .product-section, .inventory-section {
        padding: 14px;
        border-radius: var(--radius-lg);
    }
    
    .inventory-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat {
        padding: 12px 10px;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 6px;
    }
    
    .tab-btn {
        width: 100%;
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .tab-btn.active::after {
        display: none;
    }
    
    .inventory-item {
        padding: 12px;
    }
    
    .item-quantity {
        min-width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .modal {
        padding: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .modal-content {
        margin: 0 auto;
        width: 100%;
        max-width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: var(--radius-lg);
    }
    
    .modal-content.large-modal {
        margin: 0 auto;
        width: 100%;
        max-width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
    
    .modal-content h3 {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .modal-content p {
        padding: 12px 16px 0;
    }
    
    .modal-actions {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    /* Admin Panel Mobile */
    #adminPanelModal .modal-content {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
    
    #adminPanelModal .modal-content > *:not(.admin-header):not(.modal-actions) {
        padding: 0 16px;
    }
    
    .admin-header {
        padding: 14px 16px;
    }
    
    .admin-header h3 {
        font-size: 1rem;
    }
    
    .btn-close-modal {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .admin-modal-footer {
        flex-direction: column;
    }
    
    .admin-modal-footer .btn {
        max-width: none;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 16px;
    }
    
    .pagination-size {
        width: 100%;
        justify-content: center;
    }
    
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .floating-camera-btn {
        width: 56px !important;
        height: 56px !important;
        bottom: 20px !important;
        right: 20px !important;
        font-size: 24px !important;
    }
    
    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        transform: translateY(-120px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Admin mobile */
    .admin-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
        margin: 16px;
    }
    
    .admin-tab-btn {
        padding: 14px 10px;
        font-size: 0.7rem;
        gap: 6px;
    }
    
    .admin-tab-btn i {
        font-size: 1.2rem;
    }
    
    .admin-tab-btn span {
        display: block;
        line-height: 1.2;
    }
    
    .admin-tab-content {
        padding: 0 16px 20px;
    }
    
    .admin-section {
        padding: 18px;
        margin-bottom: 16px;
        border-radius: var(--radius-lg);
    }
    
    .admin-section h4 {
        font-size: 1rem;
        gap: 10px;
        padding-bottom: 14px;
        margin-bottom: 14px;
    }
    
    .admin-section h4 i {
        font-size: 0.9rem;
        width: 32px;
        height: 32px;
    }
    
    .admin-description {
        font-size: 0.85rem;
        padding: 12px 14px;
        margin-bottom: 16px;
    }
    
    .setting-item {
        padding: 16px;
        border-radius: var(--radius-lg);
    }
    
    .setting-item label {
        font-size: 0.95rem;
        gap: 14px;
    }
    
    .setting-item input[type="checkbox"] {
        width: 26px;
        height: 26px;
    }
    
    .setting-description {
        font-size: 0.8rem;
        margin: 10px 0 0 40px;
        padding: 8px 12px;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .status-item {
        padding: 16px;
    }
    
    .status-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .status-info h5 {
        font-size: 0.8rem;
    }
    
    .status-value {
        font-size: 0.95rem;
    }
    
    .admin-actions,
    .settings-actions,
    .status-actions {
        flex-direction: column;
        gap: 10px;
        padding-top: 16px;
    }
    
    .admin-actions .btn,
    .settings-actions .btn,
    .status-actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    /* Hash config mobile */
    .hash-config-item {
        padding: 14px;
    }
    
    .hash-store-name {
        font-size: 0.9rem;
    }
    
    .hash-store-description {
        font-size: 0.8rem;
    }
    
    .hash-input-group {
        margin-top: 10px;
    }
    
    .hash-input-group label {
        font-size: 0.75rem;
    }
    
    .hash-input-container {
        flex-wrap: wrap;
    }
    
    .hash-input {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .hash-input-container .btn {
        flex: 1;
    }
    
    /* Readonly inventories mobile */
    .readonly-inventories-list .setting-item {
        padding: 12px 14px;
    }
    
    /* Modal body scroll mobile */
    .modal-body-scroll {
        padding: 16px;
    }
    
    .inventory-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .inventory-item-header .btn {
        width: 100%;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .product-info h3 {
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    .product-details {
        padding: 18px;
    }
    
    .product-details .actions {
        flex-direction: column;
    }
    
    .product-details .actions .btn {
        min-width: auto;
    }
    
    .inventory-section h2 {
        font-size: 1.1rem;
        padding: 14px 16px;
    }
    
    .inventory-section h2 i {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
    }
    
    header h1 {
        font-size: 0.95rem;
    }
    
    header h1 i {
        font-size: 1rem;
    }
    
    .header-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .header-actions .btn {
        padding: 8px 6px;
        font-size: 0.65rem;
        min-height: 40px;
        gap: 4px;
    }
    
    .header-actions .btn span {
        display: inline;
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    .header-actions .btn i {
        font-size: 0.8rem;
    }
    
    .inventory-selector {
        grid-column: 1 / -1;
    }
    
    .inventory-select {
        font-size: 0.75rem;
        padding: 8px;
    }
    
    .main-content {
        padding: 10px;
        gap: 10px;
    }
    
    .product-section, .inventory-section {
        padding: 12px;
    }
    
    .stat {
        padding: 10px 8px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.55rem;
    }
    
    .inventory-item {
        padding: 10px;
    }
    
    .item-name {
        font-size: 0.85rem;
    }
    
    .item-quantity {
        min-width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .floating-camera-btn {
        width: 52px !important;
        height: 52px !important;
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
        right: max(16px, env(safe-area-inset-right)) !important;
        font-size: 20px !important;
    }
    
    .modal-content {
        margin: 0 auto;
        width: calc(100% - 12px);
        max-height: calc(100dvh - 12px);
        border-radius: var(--radius-md);
    }
    
    .modal-content h3 {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .modal-actions {
        padding: 10px 14px;
        gap: 6px;
    }
    
    .admin-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 6px;
        margin: 12px;
    }
    
    .admin-tab-btn {
        padding: 10px 8px;
        font-size: 0.65rem;
        gap: 4px;
    }
    
    .admin-tab-btn i {
        font-size: 1rem;
    }
    
    .admin-tab-btn span {
        display: none;
    }
    
    .search-container input {
        font-size: 16px !important;
        padding: 12px 14px 12px 40px;
    }
}

/* ===== TELAS MUITO PEQUENAS ===== */
@media (max-width: 360px) {
    header h1 {
        font-size: 0.85rem;
    }
    
    .header-actions .btn {
        padding: 6px 4px;
        font-size: 0.6rem;
    }
    
    .header-actions .btn span {
        display: none;
    }
    
    .stat-number {
        font-size: 1rem;
    }
}

/* ===== COMPONENTES EXTRAS ===== */
.filename-input-container {
    display: flex;
    margin: 24px 28px;
    border: 2px solid var(--gray200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#filenameInput {
    flex: 1;
    padding: 14px 18px;
    border: none;
    font-size: 1rem;
    font-family: inherit;
}

#filenameInput:focus {
    outline: none;
}

.file-extension {
    padding: 14px 18px;
    background: var(--gray100);
    color: var(--gray600);
    font-weight: 600;
    border-left: 1px solid var(--gray200);
}

.filename-suggestions {
    padding: 0 28px;
    margin-bottom: 24px;
}

.filename-suggestions p {
    padding: 0;
    margin-bottom: 10px;
    color: var(--gray500);
    font-size: 0.85rem;
}

.suggestion-btn {
    display: inline-block;
    margin: 4px 6px 4px 0;
    padding: 8px 14px;
    background: var(--gray100);
    border: 1px solid var(--gray200);
    border-radius: var(--radius-full);
    color: var(--gray700);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.suggestion-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.hash-config-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hash-config-item {
    background: var(--white);
    border: 2px solid var(--gray200);
    border-radius: var(--radius-xl);
    padding: 20px;
    transition: all var(--transition);
}

.hash-config-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.hash-store-info {
    margin-bottom: 14px;
}

.hash-store-name {
    color: var(--gray900);
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hash-store-name::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.hash-store-description {
    color: var(--gray500);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hash-input-group {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--gray200);
}

.hash-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray600);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hash-input-container {
    display: flex;
    gap: 10px;
}

.hash-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray200);
    border-radius: var(--radius-lg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: var(--gray50);
    transition: all var(--transition);
}

.hash-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primaryGlow);
    background: var(--white);
}

.hash-input::placeholder {
    color: var(--gray400);
}

.readonly-inventory-checkbox {
    width: 22px !important;
    height: 22px !important;
    accent-color: var(--primary) !important;
    cursor: pointer !important;
}

.inventory-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    margin-bottom: 12px;
    background: var(--white);
    border: 1px solid var(--gray200);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.inventory-item-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.inventory-item-card.active {
    background: var(--successLight);
    border-color: var(--success);
}

.inventory-info h5 {
    margin: 0 0 4px;
    color: var(--gray800);
    font-weight: 700;
}

.inventory-info p {
    margin: 0;
    color: var(--gray500);
    font-size: 0.85rem;
}

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

#loginModal, #usernameModal {
    z-index: 10000;
}

#scannerOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
}

#scanner {
    width: 100%;
    height: 100%;
    background: var(--gray900);
}

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

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