        /* ═══════════════════════════════════════════════════════
           CSS CROSS-BROWSER — Chrome, Safari, Edge, Firefox
           Aplicado globalmente antes de qualquer outra regra
        ═══════════════════════════════════════════════════════ */

        /* 1. position: sticky — prefixo webkit para Safari < 13 */
        .app-header, .bottom-nav, .tab-buttons, .modal-header,
        [style*="position: sticky"], [style*="position:sticky"] {
            position: -webkit-sticky;
            position: sticky;
        }

        /* 2. backdrop-filter — prefixo webkit para Safari */
        .modal-overlay, [style*="backdrop-filter"] {
            -webkit-backdrop-filter: var(--backdrop-blur, blur(3px));
            backdrop-filter: var(--backdrop-blur, blur(3px));
        }

        /* 3. user-select — prefixos para todos os browsers */
        .no-select, [style*="user-select"] {
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        /* 4. Inputs/Textareas: garantir user-select: text */
        input, textarea, select {
            -webkit-user-select: text;
            -moz-user-select: text;
            user-select: text;
        }

        /* 5. appearance: none — prefixos para Firefox/Safari */
        select, input[type="date"], input[type="time"],
        input[type="number"], input[type="search"] {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        /* 6. dvh / dvw fallback via variável CSS (calculada pelo polyfills.js) */
        /* Em browsers sem suporte a dvh, --dvh = 1% de window.innerHeight */

        /* 7. Tap highlight — remover em mobile (cross-browser) */
        * {
            -webkit-tap-highlight-color: transparent;
        }

        /* 8. Smooth scroll cross-browser */
        html {
            scroll-behavior: smooth;
            -webkit-text-size-adjust: 100%;
            -ms-text-size-adjust: 100%;
        }

        /* 9. Flexbox gap — já suportado em todos os browsers modernos.
              Mas garantimos que flex wrap funcione corretamente */
        .flex-gap-compat { margin: -4px; }
        .flex-gap-compat > * { margin: 4px; }

        /* 10. Overflow scroll com momentum no iOS (Safari) */
        .scroll-ios {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        html, body {
            overflow-x: hidden;
            width: 100%;
        }
        
        body {
            font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: linear-gradient(135deg, #0077C8 0%, #7DC242 100%);
            min-height: 100vh;
            padding-bottom: 80px;
        }
        
        /* ========================================
           LOADING SCREEN E ERROR BOUNDARY
           ======================================== */
        
        /* ⭐ ETAPA 4: Loading Screen - DESATIVADA (app abre direto na tela de login) */
        #app-loading-screen {
            display: none !important;
        }
        #app-loading-screen.hidden {
            display: none !important;
        }
        .loading-logo, .loading-spinner, .loading-text {
            display: none !important;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        @keyframes dropPulse { 0%,100% { opacity:1; transform:scale(1); } }
        @keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } }
        
        /* Error Boundary (erros críticos) */
        #app-error-boundary {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            padding: 20px;
        }
        
        #app-error-boundary.visible {
            display: flex;
        }
        
        .error-icon {
            font-size: 64px;
            color: white;
            margin-bottom: 20px;
        }
        
        .error-title {
            color: white;
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 10px;
            text-align: center;
        }
        
        .error-message {
            color: rgba(255, 255, 255, 0.9);
            font-size: 16px;
            margin-bottom: 30px;
            text-align: center;
            max-width: 600px;
            line-height: 1.6;
        }
        
        .error-actions {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            justify-content: center;
        }
        
        .error-btn {
            background: white;
            color: #dc2626;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .error-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }
        
        .error-details {
            background: rgba(0, 0, 0, 0.3);
            color: white;
            padding: 15px;
            border-radius: 8px;
            font-family: 'Courier New', monospace;
            font-size: 12px;
            max-width: 600px;
            max-height: 200px;
            overflow-y: auto;
            margin-top: 20px;
            text-align: left;
            white-space: pre-wrap;
            word-break: break-word;
        }
        
        /* ======================================== */
        
        .app-header {
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: white;
            padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.3);
            position: -webkit-sticky;
            position: sticky;
            top: 0;
            z-index: 100;
        }
        
        .container-app {
            max-width: 800px;
            width: 100%;
            margin: 20px auto;
            padding: 0 15px;
            box-sizing: border-box;
        }
        
        .card {
            background: white;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            animation: slideUp 0.3s ease-out;
            max-width: 100%;
            overflow-x: hidden;
        }
        
        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .input-group {
            margin-bottom: 20px;
        }
        
        .input-group label {
            display: block;
            font-weight: 700;
            color: #1e3a5f;
            margin-bottom: 8px;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }
        
        .input-group input,
        .input-group select,
        .input-group textarea {
            width: 100%;
            padding: 12px 16px;
            border: 1.5px solid #e2e8f0;
            border-radius: 10px;
            font-size: 16px;
            transition: all 0.3s;
            background: #f8fafc;
            color: #1f2937;
        }
        
        .input-group input:focus,
        .input-group select:focus,
        .input-group textarea:focus {
            outline: none;
            border-color: #0077C8;
            background: #fff;
            box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.1);
        }
        
        .input-group select:disabled,
        .input-group input:disabled {
            background: #f3f4f6 !important;
            color: #6b7280 !important;
            cursor: not-allowed;
            opacity: 1;
            -webkit-text-fill-color: #6b7280;
        }
        
        .input-group input.error,
        .input-group select.error {
            border-color: #ef4444;
            background: #fef2f2;
        }
        
        .input-group input.success {
            border-color: #10b981;
            background: #f0fdf4;
        }
        
        .input-group input.warning {
            border-color: #ef4444;
            background: #fee2e2;
        }
        
        .input-helper {
            font-size: 12px;
            margin-top: 4px;
            color: #6b7280;
        }
        
        .input-helper.error {
            color: #ef4444;
        }
        
        .input-helper.success {
            color: #10b981;
        }
        
        .input-helper.warning {
            color: #f59e0b;
        }
        
        .btn {
            padding: 14px 28px;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            justify-content: center;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #0077C8 0%, #7DC242 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(0, 119, 200, 0.4);
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 119, 200, 0.6);
        }
        
        .btn-secondary {
            background: #f8fafc;
            color: #374151;
            border: 1.5px solid #e2e8f0;
        }
        
        .btn-secondary:hover {
            background: #eff6ff;
            border-color: #0077C8;
            color: #0077C8;
        }

        /* ── Botões de período rápido no Histórico ── */
        .period-quick-btn {
            padding: 6px 13px;
            font-size: 12px;
            font-weight: 600;
            border: 1.5px solid #e2e8f0;
            border-radius: 20px;
            background: #f8fafc;
            color: #475569;
            cursor: pointer;
            transition: all 0.18s;
            white-space: nowrap;
            letter-spacing: 0.1px;
        }
        .period-quick-btn:hover {
            border-color: #0077C8;
            color: #0077C8;
            background: #eff6ff;
        }
        .period-quick-btn.period-active {
            background: #0077C8;
            color: #fff;
            border-color: #0077C8;
            box-shadow: 0 2px 8px rgba(0,119,200,0.30);
        }

        .btn-logout {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 10px 12px;  /* Mesma altura para todos os botões */
            font-size: 16px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            min-width: 44px;  /* Largura mínima para botões de ícone */
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .btn-logout:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
        }
        
        .btn-customize {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 10px 12px;  /* Mesma altura dos outros botões */
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
            border-radius: 8px;
            min-width: 44px;  /* Mesma largura mínima do botão sino */
            width: 44px;  /* Largura fixa igual ao sino */
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        
        .btn-customize:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
        }
        
        .btn-success {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
        }
        
        .btn-danger {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
        }
        
        .btn-warning {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: white;
        }
        
        .btn-block {
            width: 100%;
            margin-top: 10px;
        }
        
        .parameter-quick-select {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 10px;
            margin-bottom: 20px;
            background: white;
            border-radius: 8px;
        }
        
        .param-chip {
            padding: 9px 14px;
            border: 1.5px solid #e2e8f0;
            border-radius: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 13px;
            font-weight: 600;
            background: #f8fafc;
            color: #475569;
        }
        
        .param-chip:hover {
            border-color: #0077C8;
            color: #0077C8;
            background: #eff6ff;
        }
        
        .param-chip.active {
            background: #0077C8;
            color: white;
            border-color: #0077C8;
            box-shadow: 0 2px 8px rgba(0,119,200,0.30);
        }
        
        .analysis-item {
            padding: 16px;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            margin-bottom: 12px;
            background: #f9fafb;
            transition: all 0.3s;
        }
        
        .analysis-item:hover {
            border-color: #0077C8;
            background: white;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        
        .analysis-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }
        
        .analysis-title {
            font-weight: 600;
            color: #1f2937;
            font-size: 16px;
        }
        
        .analysis-date {
            color: #6b7280;
            font-size: 13px;
        }
        
        .analysis-params {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 10px;
            margin-bottom: 12px;
        }
        
        .param-value {
            display: flex;
            justify-content: space-between;
            padding: 8px 12px;
            background: white;
            border-radius: 8px;
            font-size: 14px;
        }
        
        .param-label {
            color: #6b7280;
            font-weight: 500;
        }
        
        .param-number {
            color: #1f2937;
            font-weight: 600;
        }
        
        .param-number.warning {
            color: #ef4444;
        }
        
        .param-number.danger {
            color: #ef4444;
        }
        
        .param-number.success {
            color: #10b981;
        }
        
        .analysis-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
        }
        
        .btn-icon {
            width: 36px;
            height: 36px;
            padding: 0;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }
        
        .status-badge.normal {
            background: #d1fae5;
            color: #065f46;
        }
        
        .status-badge.warning {
            background: #fee2e2;
            color: #991b1b;
        }
        
        .status-badge.critical {
            background: #fee2e2;
            color: #991b1b;
        }
        
        .status-badge.danger {
            background: #fee2e2;
            color: #991b1b;
        }
        
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
            display: flex;
            justify-content: space-around;
            padding: 12px 0;
            z-index: 100;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            color: #6b7280;
            cursor: pointer;
            transition: all 0.3s;
            padding: 8px 20px;
            border-radius: 12px;
        }
        
        .nav-item:hover,
        .nav-item.active {
            color: #0077C8;
            background: #f5f7ff;
        }
        
        .nav-item i {
            font-size: 22px;
        }
        
        .nav-item span {
            font-size: 11px;
            font-weight: 600;
        }
        
        #alertContainer {
            position: fixed;
            top: 80px;
            right: 20px;
            z-index: 9999;
            max-width: 500px;
            width: 100%;
        }
        
        .alert {
            padding: 16px;
            border-radius: 12px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            animation: slideDown 0.3s ease-out;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            transition: opacity 0.3s;
        }
        
        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .alert-success {
            background: #d1fae5;
            color: #065f46;
            border-left: 4px solid #10b981;
        }
        
        .alert-error {
            background: #fee2e2;
            color: #991b1b;
            border-left: 4px solid #ef4444;
        }
        
        .alert-warning {
            background: #fee2e2;
            color: #991b1b;
            border-left: 4px solid #ef4444;
        }
        
        .alert-info {
            background: #dbeafe;
            color: #1e40af;
            border-left: 4px solid #3b82f6;
        }
        
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #6b7280;
        }
        
        .empty-state i {
            font-size: 64px;
            color: #d1d5db;
            margin-bottom: 20px;
        }
        
        .stats-grid {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-bottom: 20px;
            overflow-x: auto;
            padding: 10px 20px;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
        }
        
        .stats-grid::-webkit-scrollbar {
            height: 6px;
        }
        
        .stats-grid::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.2);
            border-radius: 10px;
        }
        
        .stats-grid::-webkit-scrollbar-thumb {
            background: rgba(0, 119, 200, 0.5);
            border-radius: 10px;
        }
        
        .stats-grid::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 119, 200, 0.7);
        }
        
        .stat-card {
            background: linear-gradient(135deg, #0077C8 0%, #005a96 100%);
            color: white;
            padding: 24px 20px;
            border-radius: 16px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            border: 3px solid transparent;
            min-width: 140px;
            flex-shrink: 0;
            scroll-snap-align: start;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            box-sizing: border-box;
        }
        
        @media (max-width: 768px) {
            .stats-grid {
                flex-wrap: wrap;
                overflow-x: visible;
                scroll-snap-type: none;
                gap: 8px;
                padding: 5px 5px 10px 5px;
                justify-content: flex-start;
                align-items: stretch;
            }
            
            /* ⭐ ETAPA 1: Todos os cards com mesmo tamanho no mobile */
            .stat-card {
                min-width: 0 !important;
                width: calc(50% - 4px) !important;
                flex: 0 0 calc(50% - 4px) !important;
                padding: 16px 10px !important;
                box-sizing: border-box !important;
                scroll-snap-align: none;
                min-height: 90px;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
            }
            
            .stat-value {
                font-size: 28px;
            }
            
            .stat-label {
                font-size: 11px;
            }
        }
        
        @media (max-width: 400px) {
            /* ⭐ ETAPA 1: Manter mesmo tamanho em telas menores */
            .stat-card {
                width: calc(50% - 4px) !important;
                flex: 0 0 calc(50% - 4px) !important;
                padding: 14px 8px !important;
                min-height: 82px;
            }
            
            .stat-value {
                font-size: 24px;
            }
            
            .stat-label {
                font-size: 10px;
            }
        }
        
        
        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.2);
            border-color: rgba(255,255,255,0.3);
        }

        .stat-card-no-click {
            cursor: default !important;
            pointer-events: none;
        }

        .stat-card-no-click:hover {
            transform: none !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
            border-color: transparent !important;
        }
        
        .stat-card:active {
            transform: translateY(-2px);
        }
        
        .stat-value {
            font-size: 36px;
            font-weight: 700;
            margin-bottom: 8px;
            line-height: 1;
        }
        
        .stat-label {
            font-size: 13px;
            opacity: 0.95;
            font-weight: 600;
            line-height: 1.3;
        }
        
        .tab-buttons {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            overflow-x: auto;
            padding-bottom: 10px;
            -webkit-overflow-scrolling: touch;
            scroll-snap-type: x proximity;
        }
        
        .tab-buttons::-webkit-scrollbar {
            height: 6px;
        }
        
        .tab-buttons::-webkit-scrollbar-track {
            background: #f3f4f6;
            border-radius: 10px;
        }
        
        .tab-buttons::-webkit-scrollbar-thumb {
            background: rgba(0, 119, 200, 0.5);
            border-radius: 10px;
        }
        
        .tab-buttons::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 119, 200, 0.7);
        }
        
        .tab-btn {
            padding: 8px 14px;
            border: 2px solid #e5e7eb;
            background: white;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
            font-size: 13px;
            white-space: nowrap;
            transition: all 0.3s;
            flex-shrink: 0;
            scroll-snap-align: start;
        }
        
        @media (max-width: 768px) {
            .tab-buttons {
                gap: 8px;
            }
            
            .tab-btn {
                padding: 9px 14px;
                font-size: 13px;
            }
        }
        
        .tab-btn.active {
            background: linear-gradient(135deg, #0077C8 0%, #7DC242 100%);
            color: white;
            border-color: #0077C8;
        }
        
        .hidden {
            display: none !important;
        }
        
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.55);
            backdrop-filter: blur(3px);
            -webkit-backdrop-filter: blur(3px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 20px;
            animation: fadeIn 0.3s ease-out;
            overflow-y: auto;
        }
        
        @media (max-width: 640px) {
            .modal {
                padding: 8px;
                align-items: flex-start;
                padding-top: 12px;
            }
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .modal-content {
            background: white;
            border-radius: 16px;
            padding: 30px;
            max-width: 500px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            animation: scaleUp 0.3s ease-out;
        }
        
        @media (max-width: 640px) {
            .modal-content {
                border-radius: 12px;
                padding: 20px;
                max-height: 92vh;
            }
        }
        
        @keyframes scaleUp {
            from {
                opacity: 0;
                transform: scale(0.9);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        /* ===== NOVOS ESTILOS: Gráficos e Histórico (redesign moderno) ===== */

        /* Toggle switch para "Zerar cards diariamente" */
        #dailyResetToggle:checked + #toggleSlider { background: #0077C8; }
        #dailyResetToggle:checked ~ #toggleDot { transform: translateX(20px); }

        /* Responsividade filtros Histórico */
        @media (max-width: 640px) {
            #historySection [style*="grid-template-columns: 1fr 1fr 1fr"] {
                grid-template-columns: 1fr !important;
            }
            #historySection [style*="grid-template-columns: 1fr 1fr"] {
                grid-template-columns: 1fr !important;
            }
            #chartsSection [style*="grid-template-columns: 1fr 1fr"] {
                grid-template-columns: 1fr !important;
            }
        }

        /* Tipo de gráfico: destacar opção selecionada */
        input[name="chartTypeRadio"]:checked + .chart-type-option {
            border-color: #0077C8 !important;
            background: #eff6ff !important;
            color: #0077C8 !important;
        }

        /* Filtros do Histórico: 3 cols em desktop, 1 em mobile */
        @media (max-width: 768px) {
            #historySection .hist-filter-grid {
                grid-template-columns: 1fr !important;
            }
        }

        /* ===== FIM novos estilos ===== */

        /* Modal Personalizar Interface */
        #customizeInterfaceModal .modal-content {
            max-width: 450px;
        }
        
        .customize-section {
            margin-bottom: 24px;
        }
        
        .customize-section h3 {
            font-size: 14px;
            font-weight: 700;
            color: #374151;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .customize-section h3 i {
            color: #0077C8;
        }
        
        .customize-info {
            background: #eff6ff;
            border-left: 4px solid #0077C8;
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 20px;
        }
        
        .customize-info p {
            font-size: 13px;
            color: #4b5563;
            line-height: 1.5;
            margin: 0;
        }
        
        .customize-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        .customize-checkbox-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            background: #f9fafb;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .customize-checkbox-item:hover {
            background: #eff6ff;
            border-color: #0077C8;
        }
        
        .customize-checkbox-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: #0077C8;
        }
        
        .customize-checkbox-item label {
            flex: 1;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #374151;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
        }
        
        .customize-checkbox-item label i {
            font-size: 13px;
            width: 20px;
            text-align: center;
        }
        
        .customize-actions {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }
        
        .btn-restore-default {
            background: #f3f4f6;
            color: #4b5563;
            border: 2px solid #e5e7eb;
            padding: 12px 20px;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
        }
        
        .btn-restore-default:hover {
            background: #e5e7eb;
            border-color: #d1d5db;
        }
        
        .btn-save-customize {
            flex: 1;
            background: linear-gradient(135deg, #0077C8 0%, #005a9c 100%);
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 14px;
        }
        
        .btn-save-customize:hover {
            background: linear-gradient(135deg, #005a9c 0%, #004080 100%);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 119, 200, 0.3);
        }
        
        .progress-bar {
            width: 100%;
            height: 6px;
            background: #e2e8f0;
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 24px;
        }
        
        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #0077C8 0%, #7DC242 100%);
            transition: width 0.3s ease;
        }
        
        /* QR Code Modal Styles */
        #qrCodeContainer {
            text-align: center;
            padding: 20px;
        }
        
        #qrCodeCanvas {
            margin: 20px auto;
            display: inline-block;
            padding: 20px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        
        .qr-code-title {
            font-size: 24px;
            font-weight: 700;
            color: #374151;
            margin-bottom: 12px;
        }
        
        .qr-code-subtitle {
            font-size: 14px;
            color: #6b7280;
            margin-bottom: 24px;
        }
        
        /* QR Scanner Styles */
        #qr-scanner-container {
            margin: 20px 0;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        
        #qr-reader {
            width: 100% !important;
            border: none !important;
        }
        
        #qr-reader__dashboard_section_csr {
            text-align: center !important;
        }
        
        #qr-reader video {
            border-radius: 8px;
        }
        
        .qr-scanner-info {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 14px;
            margin: 10px 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        /* QR Code Modal - Responsividade Mobile */
        @media (max-width: 640px) {
            #qrCodeDisplayModal .modal-content {
                max-width: 95vw !important;
                width: 95vw !important;
                margin: 10px auto;
                max-height: 92vh !important;
            }
            
            #qrCodeDisplayModal .modal-content > div:first-child {
                padding: 16px 20px !important;
            }
            
            #qrCodeDisplayModal .modal-content > div:first-child h2 {
                font-size: 18px !important;
            }
            
            #qrCodeDisplayModal .modal-content > div:first-child h2 i {
                font-size: 20px !important;
            }
            
            #qrCodeDisplayModal .modal-content > div:last-child {
                padding: 20px !important;
            }
            
            /* Scanner section mobile */
            #qrCodeDisplayModal div[style*="linear-gradient(135deg, #10b981"] > div:first-child {
                flex-direction: column;
                align-items: stretch !important;
            }
            
            #qrCodeDisplayModal div[style*="linear-gradient(135deg, #10b981"] h3 {
                font-size: 16px !important;
            }
            
            #qrCodeDisplayModal div[style*="linear-gradient(135deg, #10b981"] p {
                font-size: 13px !important;
            }
            
            #qrCodeDisplayModal #toggleScannerBtn {
                width: 100%;
                justify-content: center;
                margin-top: 8px;
            }
            
            /* QR Code genérico section mobile */
            #qrCodeDisplayModal div[style*="linear-gradient(135deg, #fef3c7"] h3 {
                font-size: 16px !important;
            }
            
            #qrCodeDisplayModal div[style*="linear-gradient(135deg, #fef3c7"] p {
                font-size: 13px !important;
            }
            
            #qrCodeDisplayModal #qrCodeCanvas {
                max-width: 100%;
            }
            
            #qrCodeDisplayModal #qrCodeCanvas canvas {
                max-width: 100% !important;
                height: auto !important;
            }
            
            /* Botões mobile */
            #qrCodeDisplayModal .btn-block {
                padding: 12px !important;
                font-size: 15px !important;
            }
        }
        
        /* Tablets e telas médias */
        @media (min-width: 641px) and (max-width: 768px) {
            #qrCodeDisplayModal .modal-content {
                max-width: 90vw !important;
            }
        }
        
        .qr-scanner-error {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 14px;
            margin: 10px 0;
        }
        
        .qr-scanner-success {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 16px;
            border-radius: 8px;
            font-size: 14px;
            margin: 10px 0;
            animation: successPulse 0.5s ease;
        }
        
        @keyframes successPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.02); }
        }
        
        /* QR Code Configuration Styles */
        .qr-config-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 2px solid #e5e7eb;
        }
        
        .qr-list-item {
            background: #f9fafb;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 12px;
            transition: all 0.3s;
        }
        
        .qr-list-item:hover {
            border-color: #0077C8;
            box-shadow: 0 4px 12px rgba(0, 119, 200, 0.1);
        }
        
        .qr-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }
        
        .qr-item-title {
            font-size: 16px;
            font-weight: 600;
            color: #374151;
        }
        
        .qr-item-actions {
            display: flex;
            gap: 8px;
        }
        
        .qr-item-info {
            font-size: 13px;
            color: #6b7280;
            line-height: 1.6;
        }
        
        .qr-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            margin-right: 8px;
        }
        
        .qr-badge-company {
            background: #dbeafe;
            color: #1e40af;
        }
        
        .qr-badge-station {
            background: #fef3c7;
            color: #92400e;
        }
        
        .qr-badge-point {
            background: #d1fae5;
            color: #065f46;
        }
        
        /* Switch Toggle Styles */
        .switch-toggle {
            position: relative;
            display: inline-block;
            width: 52px;
            height: 28px;
        }
        
        .switch-toggle input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .switch-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #cbd5e1;
            transition: 0.3s;
            border-radius: 28px;
        }
        
        .switch-slider:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: 0.3s;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }
        
        .switch-toggle input:checked + .switch-slider {
            background-color: #10b981;
        }
        
        .switch-toggle input:checked + .switch-slider:before {
            transform: translateX(24px);
        }
        
        .switch-toggle input:focus + .switch-slider {
            box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
        }
        
        @media (max-width: 640px) {
            .parameter-quick-select {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .analysis-params {
                grid-template-columns: 1fr;
            }
            
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .app-header > div {
                flex-direction: column;
                gap: 10px;
            }
            
            .app-header > div > div:last-child {
                width: 100%;
                justify-content: space-between !important;
            }
            
            /* Histórico de Análises - Mobile Optimizations */
            #historySection h2 {
                font-size: 16px !important;
            }
            
            #historySection .btn {
                font-size: 12px !important;
                padding: 7px 12px !important;
                min-width: 100px !important;
            }
            
            /* Área de filtros - responsivo */
            #historySection .history-filters {
                gap: 10px !important;
            }
            
            /* Filtros de data - empilhar em telas muito pequenas */
            #historySection .history-filters > div:first-child {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }
            
            /* Inputs e selects */
            #historySection input[type="date"],
            #historySection select {
                padding: 8px !important;
                font-size: 13px !important;
            }
            
            /* Labels */
            #historySection label {
                font-size: 11px !important;
            }
            
            /* Toggle de modo diário/acumulado */
            #statsModeToggle {
                padding: 10px !important;
            }
            
            #statsModeToggle label {
                font-size: 12px !important;
            }
            
            /* Filtros de data dos gráficos responsivos */
            .chart-date-filters > div {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }
            
            /* Header - Mobile Optimizado */
            .app-header {
                padding: 12px 15px !important;
            }
            
            .app-header > div {
                gap: 12px !important;
            }
            
            .app-header h1 {
                font-size: 20px !important;
                margin-bottom: 2px !important;
            }
            
            .app-header h1 i {
                font-size: 18px !important;
            }
            
            .app-header p {
                font-size: 10px !important;
            }
            
            /* Área direita do header */
            .app-header > div > div:last-child {
                gap: 8px !important;
            }
            
            /* Info do usuário e hora */
            .app-header > div > div:last-child > div:first-child {
                text-align: right;
            }
            
            #userInfo {
                font-size: 9px !important;
                margin-bottom: 2px !important;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                max-width: 150px;
            }
            
            #currentTime {
                font-size: 22px !important;
                font-weight: 700 !important;
                line-height: 1 !important;
            }
            
            #currentDate {
                font-size: 9px !important;
                margin-top: 2px !important;
            }
            
            /* Botões do header */
            .btn-logout {
                font-size: 11px !important;
                padding: 8px 10px !important;  /* Mesma altura para todos */
                white-space: nowrap !important;
                min-width: 40px !important;  /* Largura mínima consistente */
            }
            
            .btn-logout i {
                font-size: 12px !important;
            }
            
            .btn-customize {
                padding: 8px 10px !important;  /* Mesma altura */
                font-size: 15px !important;
                width: 40px !important;  /* Mesma largura do sino */
                min-width: 40px !important;
            }
            
            /* Sininho de notificações */
            #notificationBell {
                padding: 8px 10px !important;  /* Consistente */
                font-size: 15px !important;
                width: 40px !important;  /* Largura fixa igual ao filtro */
            }
            
            /* Ícone do sino - mesma espessura do filtro */
            #notificationBell i.fa-bell,
            #notificationBellMobile i.fa-bell {
                font-weight: 900 !important;  /* Font Awesome Solid (mais grosso) */
                font-size: 15px !important;
            }
            
            /* Ícone do filtro para comparação */
            .btn-customize i.fa-sliders-h,
            #customizeInterfaceBtnMobile i.fa-sliders-h {
                font-weight: 900 !important;
                font-size: 15px !important;
            }
            
            #notificationBadge {
                width: 16px !important;
                height: 16px !important;
                font-size: 9px !important;
                top: -4px !important;
                right: -4px !important;
            }
        }
        
        /* Extra small devices (< 480px) */
        @media (max-width: 480px) {
            /* Reduzir padding do card */
            .card {
                padding: 16px !important;
            }
            
            /* Histórico - ainda mais compacto */
            #historySection h2 {
                font-size: 15px !important;
            }
            
            #historySection .btn {
                font-size: 11px !important;
                padding: 6px 10px !important;
                min-width: 90px !important;
            }
            
            /* Área de filtros com menos padding */
            #historySection .history-filters {
                padding: 12px !important;
            }
            
            /* Labels ainda menores */
            #historySection label {
                font-size: 10px !important;
            }
            
            /* Inputs e selects menores */
            #historySection input[type="date"],
            #historySection select {
                padding: 7px !important;
                font-size: 12px !important;
            }
            
            /* Header - Extra Small (<480px) - Novo Layout Mobile */
            .app-header {
                padding: 12px 15px 10px 15px !important;
            }
            
            /* Ocultar elementos desktop em mobile */
            .header-datetime-desktop,
            .header-actions-desktop {
                display: none !important;
            }
            
            /* Mostrar rodapé mobile */
            .header-footer-mobile {
                display: grid !important;
                grid-template-columns: 1fr auto 1fr !important;
                align-items: center !important;
                gap: 10px !important;
                margin-top: 12px !important;
                padding-top: 10px !important;
                border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
            }
            
            /* Título e usuário centralizados no topo */
            .app-header > div:first-child {
                grid-template-columns: 1fr !important;
                text-align: center !important;
            }
            
            .app-header > div:first-child > div:nth-child(2) {
                grid-column: 1 !important;
            }
            
            .app-header h1 {
                font-size: 18px !important;
                margin-bottom: 3px !important;
            }
            
            .app-header h1 i {
                font-size: 16px !important;
            }
            
            #userInfo {
                font-size: 8px !important;
            }
            
            #currentTime {
                font-size: 18px !important;
            }
            
            #currentDate {
                font-size: 8px !important;
            }
            
            .btn-logout {
                font-size: 10px !important;
                padding: 7px 10px !important;
            }
            
            .btn-logout i {
                font-size: 11px !important;
            }
            
            #notificationBell {
                padding: 7px 9px !important;
                font-size: 13px !important;
            }
            
            #notificationBadge {
                width: 14px !important;
                height: 14px !important;
                font-size: 8px !important;
            }
        }
        
        /* Ultra small devices (< 360px) - Texto "Sair" oculto */
        @media (max-width: 360px) {
            .app-header {
                padding: 8px 10px !important;
            }
            
            .app-header h1 {
                font-size: 16px !important;
            }
            
            .app-header h1 i {
                font-size: 14px !important;
            }
            
            /* Ocultar texto "Sair" */
            .btn-logout .btn-text {
                display: none !important;
            }
            
            .btn-logout:not(#notificationBell) {
                padding: 7px 9px !important;
            }
            
            .btn-logout:not(#notificationBell) i {
                margin-right: 0 !important;
                font-size: 12px !important;
            }
            
            #userInfo {
                font-size: 7px !important;
            }
            
            #currentTime {
                font-size: 16px !important;
            }
            
            #currentDate {
                font-size: 7px !important;
            }
        }
        
        /* ========================================
           RESPONSIVIDADE: FILTROS DE GRÁFICOS
           ======================================== */
        
        /* Tablet e Mobile (< 768px) */
        @media (max-width: 768px) {
            /* Grids de 2 colunas viram 1 coluna */
            .chart-grid-2cols {
                display: flex !important;
                flex-direction: column !important;
                gap: 12px !important;
            }
            
            /* IMPORTANTE: Filtros de data com display: none devem permanecer ocultos */
            .chart-date-filter[style*="display: none"] {
                display: none !important;
            }
            
            /* Filtro de período quando visível (Modo 1) */
            #chartPeriodFilters:not([style*="display: none"]) {
                display: flex !important;
                flex-direction: column !important;
                gap: 12px !important;
            }
            
            /* Filtro de data única quando visível (Modos 2 e 3) */
            #chartSingleDateFilter:not([style*="display: none"]) {
                display: block !important;
            }
            
            /* Grid de parâmetros vira 1 coluna */
            .chart-params-grid {
                display: flex !important;
                flex-direction: column !important;
                gap: 12px !important;
            }
            
            /* Cards de parâmetros ocupam largura total */
            .chart-param-card {
                width: 100% !important;
            }
            
            /* Ajustes de padding */
            .chart-filters-main {
                padding: 12px !important;
            }
            
            /* Títulos menores */
            .chart-filters-main h3 {
                font-size: 13px !important;
            }
            
            /* Labels menores */
            .chart-filters-main label {
                font-size: 12px !important;
            }
            
            /* Selects e inputs responsivos */
            .chart-filters-main select,
            .chart-filters-main input[type="date"] {
                font-size: 14px !important;
                padding: 8px !important;
                max-width: 100% !important;
                width: 100% !important;
            }
            
            /* Cards de parâmetros */
            .chart-param-card {
                padding: 10px !important;
            }
            
            /* Garantir que inputs de data não estouram */
            #chartDateStart,
            #chartDateEnd,
            #chartSingleDate {
                max-width: 100% !important;
                width: 100% !important;
                box-sizing: border-box !important;
            }
        }
        
        /* Mobile pequeno (< 480px) */
        @media (max-width: 480px) {
            .chart-filters-main {
                padding: 10px !important;
                margin-bottom: 12px !important;
            }
            
            .chart-filters-main h3 {
                font-size: 12px !important;
                margin-bottom: 8px !important;
            }
            
            .chart-filters-main label {
                font-size: 11px !important;
            }
            
            .chart-filters-main select,
            .chart-filters-main input[type="date"] {
                font-size: 13px !important;
                padding: 7px !important;
            }
            
            /* Ícones menores */
            .chart-filters-main i {
                font-size: 11px !important;
            }
            
            /* Texto de ajuda menor */
            .chart-filters-main p {
                font-size: 11px !important;
            }
            
            /* Cards de parâmetros mais compactos */
            .chart-param-card {
                padding: 8px !important;
            }
            
            /* Reduzir espaçamento entre campos */
            .chart-grid-2cols,
            .chart-params-grid {
                gap: 10px !important;
            }
        }
        
        /* Mobile extra pequeno (< 360px) */
        @media (max-width: 360px) {
            .chart-filters-main {
                padding: 8px !important;
            }
            
            .chart-filters-main h3 {
                font-size: 11px !important;
            }
            
            .chart-filters-main label {
                font-size: 10px !important;
            }
            
            .chart-filters-main select,
            .chart-filters-main input[type="date"] {
                font-size: 12px !important;
                padding: 6px !important;
            }
            
            .chart-filters-main i {
                font-size: 10px !important;
            }
            
            .chart-filters-main p {
                font-size: 10px !important;
            }
            
            .chart-param-card {
                padding: 6px !important;
            }
            
            /* Espaçamento mínimo */
            .chart-grid-2cols,
            .chart-params-grid {
                gap: 8px !important;
            }
        }
        
        /* ========================================
           GRÁFICO FULLSCREEN EM LANDSCAPE
           ======================================== */
        
        /* Mostrar botão de ampliar apenas em mobile */
        @media (max-width: 768px) {
            #expandChartBtn {
                display: inline-block !important;
            }
        }
        
        /* Modo Fullscreen do Gráfico */
        #chartContainer.fullscreen-chart {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            width: 100vw !important;
            height: 100vh !important;
            z-index: 9999 !important;
            background: white !important;
            padding: 15px !important;
            border-radius: 0 !important;
            margin: 0 !important;
            overflow: hidden !important;
            display: flex !important;
            flex-direction: column !important;
        }
        
        #chartContainer.fullscreen-chart #chartCanvasWrapper {
            width: 100% !important;
            height: calc(100vh - 60px) !important;
            position: relative !important;
            flex: 1 !important;
            display: flex !important;
        }
        
        #chartContainer.fullscreen-chart #trendChart {
            width: 100% !important;
            height: 100% !important;
            max-width: 100% !important;
            max-height: 100% !important;
            display: block !important;
        }
        
        #chartContainer.fullscreen-chart #expandChartBtn {
            background: rgba(239,68,68,0.9) !important;
            position: fixed !important;
            top: 10px !important;
            right: 10px !important;
            width: 32px !important;
            height: 32px !important;
            padding: 0 !important;
            font-size: 16px !important;
            font-weight: 700 !important;
            z-index: 10001 !important;
            flex-shrink: 0 !important;
            display: none !important;
            border-radius: 50% !important;
            align-items: center !important;
            justify-content: center !important;
            line-height: 1 !important;
        }
        
        /* Ocultar overflow do body quando fullscreen (sem position:fixed que trava rotação) */
        body.chart-fullscreen-active {
            overflow: hidden !important;
            touch-action: none !important;
        }
        
        /* ── Landscape: gráfico ocupa tela inteira (com safe-area para notch) ── */
        @media (max-width: 900px) and (orientation: landscape) {
            #chartContainer.fullscreen-chart {
                padding: 6px
                         max(6px, env(safe-area-inset-top))
                         max(6px, env(safe-area-inset-right))
                         max(6px, env(safe-area-inset-bottom))
                         max(6px, env(safe-area-inset-left)) !important;
                /* Ocupa 100% incluindo a área do notch */
                width:  100vw !important;
                width:  100dvw !important;
                height: 100vh !important;
                height: 100dvh !important;
                box-sizing: border-box !important;
            }

            #chartContainer.fullscreen-chart #chartCanvasWrapper {
                height: 100% !important;
                flex: 1 !important;
            }

            #chartContainer.fullscreen-chart #expandChartBtn {
                display: none !important;
            }

            #closeFullscreenBtn {
                top: max(6px, env(safe-area-inset-top)) !important;
                right: max(6px, env(safe-area-inset-right)) !important;
                width: 30px !important;
                height: 30px !important;
                font-size: 15px !important;
            }
        }

        /* ── Portrait: canvas ocupa espaço abaixo do cabeçalho ── */
        @media (max-width: 768px) and (orientation: portrait) {
            #chartContainer.fullscreen-chart #chartCanvasWrapper {
                height: calc(100vh - 60px) !important;
                height: calc(100dvh - 60px) !important;
            }
        }
        
        /* Animação suave */
        #chartContainer {
            transition: all 0.3s ease-in-out;
        }
        
        /* ✅ v2.34.0: Estilos da Aba de Backups */
        .backup-tab-btn {
            padding: 12px 20px;
            border: none;
            background: transparent;
            color: #6b7280;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.2s;
        }
        
        .backup-tab-btn:hover {
            color: #3b82f6;
            background: #f0f9ff;
        }
        
        .backup-tab-btn.active {
            color: #3b82f6;
            border-bottom-color: #3b82f6;
            font-weight: 600;
        }
        
        .backup-tab-btn .badge {
            background: #e5e7eb;
            color: #374151;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 11px;
            margin-left: 5px;
            font-weight: 600;
        }
        
        .backup-tab-btn.active .badge {
            background: #3b82f6;
            color: white;
        }
        
        .backup-tab-content {
            animation: fadeIn 0.3s ease-in-out;
        }
        
        #uploadArea {
            transition: all 0.3s;
        }
        
        #uploadArea:hover {
            border-color: #3b82f6;
            background: #f0f9ff;
        }
        
        .analysis-row {
            display: grid;
            grid-template-columns: 120px 150px 150px 150px auto;
            gap: 15px;
            padding: 15px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            margin-bottom: 10px;
            background: white;
            transition: all 0.2s;
        }
        
        .analysis-row:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            transform: translateY(-2px);
        }
        
        @media (max-width: 768px) {
            .analysis-row {
                grid-template-columns: 1fr;
                gap: 10px;
            }
            
            /* Mobile: Esconder texto dos botões, manter apenas ícones */
            .hide-mobile {
                display: none;
            }
            
            /* Modal responsivo */
            .modal-content {
                padding: 10px !important;
                max-width: 100% !important;
                margin: 10px !important;
            }
            
            /* Card de QR Code em mobile */
            .qr-code-item {
                padding: 10px !important;
            }
            
            /* 🔧 v2.46.14: Layout responsivo para Histórico de Edições */
            #editHistorySection div[style*="grid-template-columns: 1fr 1fr"] {
                grid-template-columns: 1fr !important;
                gap: 15px !important;
            }
            
            #editHistorySection div[style*="grid-template-columns: 1fr 1fr 120px"] {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }
            
            #editHistorySection button[onclick="clearEditHistoryFilters()"] {
                width: 100%;
                margin-top: 5px;
            }
            
            /* 🔧 v2.46.14: Layout responsivo para Nova Análise */
            #formSection div[style*="grid-template-columns: 1fr 1fr"] {
                grid-template-columns: 1fr !important;
                gap: 12px !important;
            }
            
            #formSection .input-group label {
                font-size: 11px !important;
            }
            
            #formSection input, #formSection select, #formSection textarea {
                font-size: 14px !important;
                padding: 10px 12px !important;
            }
            
            /* Data e Hora em mobile: manter lado a lado se couber */
            @media (min-width: 400px) {
                #formSection div[style*="grid-template-columns: 1fr 1fr"]:has(#analysisDate) {
                    grid-template-columns: 1fr 1fr !important;
                    gap: 10px !important;
                }
            }
        }
        
        /* Toggle Switch para permissões */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }
        
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #cbd5e1;
            transition: 0.3s;
            border-radius: 24px;
        }
        
        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: 0.3s;
            border-radius: 50%;
        }
        
        .toggle-switch input:checked + .toggle-slider {
            background-color: #10b981;
        }
        
        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(20px);
        }
        
        .toggle-switch input:disabled + .toggle-slider {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* ── Badge de aviso no filtro de empresas ── */
        @keyframes badgePulse {
            0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
            50%       { transform: scale(1.15); box-shadow: 0 0 0 5px rgba(239,68,68,0); }
        }

        /* ── Empresa bloqueada no select do filtro ── */
        .company-filter-blocked-notice {
            background: #fff8f0;
            border: 1.5px solid #fed7aa;
            border-radius: 10px;
            padding: 12px 14px;
            margin-top: 14px;
            display: flex;
            align-items: flex-start;
            gap: 10px;
        }
        .company-filter-blocked-notice i {
            color: #f59e0b;
            font-size: 16px;
            flex-shrink: 0;
            margin-top: 1px;
        }
        .company-filter-blocked-notice p {
            font-size: 12px;
            color: #92400e;
            margin: 0;
            line-height: 1.5;
        }

        /* ── MODAL DE VAZÃO (vzModalLeitura) ── */
        /* Estado padrão: invisível mas renderizável */
        #vzModalLeitura,
        #vzModalDetalhes,
        #vzModalExcluir {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 10001;
            align-items: center;
            justify-content: center;
            padding: 20px;
            box-sizing: border-box;
            -webkit-overflow-scrolling: touch;
        }
        /* Quando ativo: mostrar como flex */
        .vz-modal-overlay.vz-modal-active,
        #vzModalLeitura.vz-modal-active {
            display: flex !important;
        }
        #vzModalLeitura .vz-modal,
        #vzModalDetalhes .vz-modal,
        #vzModalExcluir .vz-modal {
            background: #fff;
            border-radius: 16px;
            width: 100%;
            max-width: 620px;
            max-height: calc(100vh - 40px);
            max-height: calc(100dvh - 40px);
            min-height: 0;
            display: flex;
            flex-direction: column;
            box-shadow: 0 8px 40px rgba(0,0,0,0.22);
            overflow: hidden;
            flex-shrink: 1;
            animation: vzModalIn 0.25s cubic-bezier(.4,0,.2,1) forwards;
        }
        @keyframes vzModalIn {
            from { opacity: 0; transform: scale(0.95) translateY(16px); }
            to   { opacity: 1; transform: scale(1) translateY(0); }
        }
        @media (max-width: 640px) {
            #vzModalLeitura,
            #vzModalDetalhes,
            #vzModalExcluir { padding: 10px; }
            #vzModalLeitura .vz-modal,
            #vzModalDetalhes .vz-modal,
            #vzModalExcluir .vz-modal { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
        }
