/* ========================================
   CÉU AZUL CALÇADOS - SISTEMA SEPARAÇÃO
   UI Premium, Moderna, Focada em Produtividade
======================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ========== LOGIN ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
    min-height: 100vh;
}

.login-container { width: 100%; max-width: 420px; padding: 20px; }

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 44px 36px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.login-header { text-align: center; margin-bottom: 36px; }
.login-header h1 { font-size: 26px; color: var(--gray-900); font-weight: 800; }
.login-header p { color: var(--gray-500); margin-top: 6px; font-size: 14px; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 16px;
    border: 2px solid var(--gray-200); border-radius: var(--radius);
    font-size: 15px; transition: all 0.2s; background: var(--gray-50);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.1); background: white;
}
.form-group textarea { resize: vertical; min-height: 120px; font-family: monospace; font-size: 13px; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: white; border: 2px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ========== ALERTS ========== */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-top: 16px; font-size: 14px; font-weight: 500; }
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #86efac; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }

/* ========== LAYOUT PAINEL ========== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px; background: var(--gray-900); color: white;
    padding: 24px 0; position: fixed; height: 100vh; overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar-header { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 16px; }
.sidebar-header h2 { font-size: 17px; color: white; font-weight: 700; }
.sidebar-header small { color: var(--gray-400); font-size: 12px; }

.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 24px; color: var(--gray-400);
    text-decoration: none; font-size: 13px; font-weight: 500;
    transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar-nav a.active { background: rgba(37,99,235,0.15); color: #93c5fd; border-left-color: var(--primary); }

.main-content { flex: 1; margin-left: 260px; padding: 32px; background: var(--gray-50); }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-header h1 { font-size: 26px; color: var(--gray-900); font-weight: 800; }

/* ========== CARDS ========== */
.card {
    background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
    border: 1px solid var(--gray-100);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h3 { font-size: 15px; color: var(--gray-800); font-weight: 700; }

/* ========== STATS ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: white; border-radius: var(--radius-lg); padding: 22px;
    box-shadow: var(--shadow); border: 1px solid var(--gray-100);
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-value { font-size: 30px; font-weight: 800; color: var(--gray-900); }
.stat-card .stat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* ========== TABLES ========== */
.table-container { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
table th { background: var(--gray-50); font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.3px; font-size: 11px; }
table tr:hover { background: var(--gray-50); }

/* ========== BADGES ========== */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.badge-pending { background: var(--warning-light); color: #92400e; }
.badge-progress { background: #dbeafe; color: #1e40af; }
.badge-done { background: var(--success-light); color: #166534; }
.badge-error { background: var(--danger-light); color: var(--danger); }

/* ========== MODAL ========== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; padding: 28px; box-shadow: 0 25px 50px rgba(0,0,0,0.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray-400); }

/* ========== COLETOR MOBILE ========== */
.mobile-layout { max-width: 480px; margin: 0 auto; padding: 16px; min-height: 100vh; }
.mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; margin-bottom: 16px; border-bottom: 1px solid var(--gray-200); }
.mobile-header h2 { font-size: 18px; }

.scanner-area { background: #000; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; aspect-ratio: 4/3; position: relative; }
#reader { width: 100%; height: 100%; }

.product-card { background: white; border: 2px solid var(--gray-200); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; transition: all 0.3s; }
.product-card.scanned { border-color: var(--success); background: var(--success-light); }
.product-card.current { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.15); }
.product-card .product-sku { font-size: 18px; font-weight: 800; color: var(--gray-900); }
.product-card .product-desc { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.product-card .product-location { display: inline-block; margin-top: 8px; padding: 4px 10px; background: var(--gray-100); border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--gray-600); }

/* Thumbnails de produto */
.product-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.product-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 2px solid var(--gray-200); }
.product-card.current .product-thumb { border-color: var(--primary); }

/* ========== PROGRESS ========== */
.progress-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.progress-bar .progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); border-radius: 4px; transition: width 0.5s ease; }
.progress-text { font-size: 13px; color: var(--gray-500); text-align: center; }

/* ========== PONTOS ANIMAÇÃO ========== */
.points-popup { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: linear-gradient(135deg, var(--success), #4ade80); color: white; padding: 24px 48px; border-radius: var(--radius-lg); font-size: 26px; font-weight: 800; z-index: 2000; animation: pointsIn 0.5s ease forwards; display: none; box-shadow: 0 20px 40px rgba(22,163,74,0.3); }
@keyframes pointsIn { 0% { opacity:0; transform: translate(-50%,-50%) scale(0.5); } 50% { transform: translate(-50%,-50%) scale(1.1); } 100% { opacity:1; transform: translate(-50%,-50%) scale(1); } }

/* ========== FOTO ERRO ========== */
.photo-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius); margin-top: 12px; display: none; }

/* ========== RESPONSIVO ========== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none !important; }
