{"id":1090,"date":"2026-04-16T19:02:07","date_gmt":"2026-04-16T19:02:07","guid":{"rendered":"http:\/\/jecoz12.com.br\/home\/"},"modified":"2026-04-16T22:14:32","modified_gmt":"2026-04-16T22:14:32","slug":"home","status":"publish","type":"page","link":"https:\/\/jecoz12.com.br\/","title":{"rendered":""},"content":{"rendered":"\n\n<!DOCTYPE html>\n<html lang=\"pt-BR\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Sistema de Senhas &#8211; Balc\u00e3o de Informa\u00e7\u00f5es<\/title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            min-height: 100vh;\n            padding: 15px;\n        }\n\n        .container {\n            max-width: 1600px;\n            margin: 0 auto;\n        }\n\n        .header {\n            background: white;\n            border-radius: 15px;\n            padding: 20px 30px;\n            margin-bottom: 20px;\n            box-shadow: 0 10px 30px rgba(0,0,0,0.3);\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            flex-wrap: wrap;\n            gap: 15px;\n        }\n\n        .header h1 {\n            color: #667eea;\n            font-size: 2em;\n        }\n\n        .header-controls {\n            display: flex;\n            gap: 12px;\n            flex-wrap: wrap;\n        }\n\n        .btn-header {\n            padding: 12px 25px;\n            color: white;\n            border: none;\n            border-radius: 10px;\n            font-size: 1em;\n            font-weight: bold;\n            cursor: pointer;\n            transition: all 0.3s;\n        }\n\n        .btn-painel {\n            background: linear-gradient(135deg, #10b981 0%, #059669 100%);\n        }\n\n        .btn-relatorio {\n            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);\n        }\n\n        .btn-limpar {\n            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);\n        }\n\n        .btn-header:hover {\n            transform: translateY(-2px);\n            box-shadow: 0 5px 15px rgba(0,0,0,0.3);\n        }\n\n        .status-indicator {\n            display: flex;\n            align-items: center;\n            gap: 10px;\n            padding: 10px 20px;\n            background: #f0f4ff;\n            border-radius: 10px;\n        }\n\n        .status-dot {\n            width: 12px;\n            height: 12px;\n            border-radius: 50%;\n            background: #10b981;\n            animation: pulse 2s infinite;\n        }\n\n        @keyframes pulse {\n            0%, 100% { opacity: 1; }\n            50% { opacity: 0.5; }\n        }\n\n        .main-grid {\n            display: grid;\n            grid-template-columns: 420px 1fr;\n            gap: 20px;\n            margin-bottom: 20px;\n        }\n\n        .card {\n            background: white;\n            border-radius: 15px;\n            padding: 25px;\n            box-shadow: 0 10px 30px rgba(0,0,0,0.3);\n        }\n\n        .card h2 {\n            color: #667eea;\n            margin-bottom: 20px;\n            font-size: 1.6em;\n            border-bottom: 3px solid #667eea;\n            padding-bottom: 10px;\n        }\n\n        \/* Gerador de Senhas *\/\n        .tipos-senha {\n            display: grid;\n            grid-template-columns: 1fr;\n            gap: 12px;\n        }\n\n        .btn-tipo {\n            padding: 18px 20px;\n            font-size: 1.1em;\n            font-weight: bold;\n            border: none;\n            border-radius: 10px;\n            cursor: pointer;\n            transition: all 0.3s;\n            color: white;\n            text-align: left;\n            display: flex;\n            align-items: center;\n            gap: 12px;\n        }\n\n        .btn-tipo .icon {\n            font-size: 1.5em;\n        }\n\n        .btn-tipo .label {\n            flex: 1;\n        }\n\n        .btn-tipo .count {\n            background: rgba(255,255,255,0.3);\n            padding: 4px 12px;\n            border-radius: 20px;\n            font-size: 0.9em;\n        }\n\n        .btn-andamento {\n            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);\n        }\n\n        .btn-andamento-pref {\n            background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);\n        }\n\n        .btn-triagem {\n            background: linear-gradient(135deg, #10b981 0%, #059669 100%);\n        }\n\n        .btn-triagem-pref {\n            background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);\n        }\n\n        .btn-entrega {\n            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);\n        }\n\n        .btn-entrega-pref {\n            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);\n        }\n\n        .btn-tipo:hover {\n            transform: translateX(5px);\n            box-shadow: 0 5px 15px rgba(0,0,0,0.3);\n        }\n\n        .senha-gerada {\n            margin-top: 20px;\n            padding: 25px;\n            background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);\n            border-radius: 12px;\n            text-align: center;\n            border: 3px dashed #667eea;\n            animation: fadeIn 0.5s ease;\n        }\n\n        @keyframes fadeIn {\n            from { opacity: 0; transform: translateY(-10px); }\n            to { opacity: 1; transform: translateY(0); }\n        }\n\n        .senha-numero {\n            font-size: 4em;\n            font-weight: bold;\n            color: #667eea;\n            margin: 15px 0;\n            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);\n        }\n\n        .senha-info {\n            color: #666;\n            font-size: 1em;\n            margin: 8px 0;\n            font-weight: 500;\n        }\n\n        .btn-imprimir {\n            margin-top: 15px;\n            padding: 12px 30px;\n            background: #667eea;\n            color: white;\n            border: none;\n            border-radius: 8px;\n            font-weight: bold;\n            cursor: pointer;\n            transition: all 0.3s;\n        }\n\n        .btn-imprimir:hover {\n            background: #764ba2;\n            transform: translateY(-2px);\n        }\n\n        \/* Painel de Atendimento *\/\n        .atendimento-grid {\n            display: grid;\n            grid-template-columns: 1fr 1fr;\n            gap: 20px;\n            margin-bottom: 20px;\n        }\n\n        .guiche-card {\n            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n            border-radius: 12px;\n            padding: 20px;\n            border: 2px solid #e2e8f0;\n        }\n\n        .guiche-card h3 {\n            color: #667eea;\n            margin-bottom: 10px;\n            display: flex;\n            align-items: center;\n            gap: 10px;\n            font-size: 1.3em;\n        }\n\n        .guiche-especialidade {\n            font-size: 0.85em;\n            color: #64748b;\n            margin-bottom: 15px;\n            padding: 8px 12px;\n            background: rgba(102, 126, 234, 0.1);\n            border-radius: 6px;\n            font-weight: 600;\n        }\n\n        .controles-guiche {\n            display: flex;\n            gap: 10px;\n            margin-bottom: 15px;\n            flex-wrap: wrap;\n        }\n\n        .btn-controle {\n            flex: 1;\n            min-width: 120px;\n            padding: 12px 15px;\n            font-size: 0.95em;\n            font-weight: bold;\n            border: none;\n            border-radius: 8px;\n            cursor: pointer;\n            transition: all 0.3s;\n            color: white;\n        }\n\n        .btn-chamar {\n            background: linear-gradient(135deg, #10b981 0%, #059669 100%);\n        }\n\n        .btn-rechamar {\n            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);\n        }\n\n        .btn-finalizar {\n            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);\n        }\n\n        .btn-controle:hover:not(:disabled) {\n            transform: translateY(-2px);\n            box-shadow: 0 4px 12px rgba(0,0,0,0.2);\n        }\n\n        .btn-controle:disabled {\n            opacity: 0.4;\n            cursor: not-allowed;\n        }\n\n        .atendimento-atual {\n            background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);\n            border-left: 5px solid #10b981;\n            padding: 15px;\n            border-radius: 8px;\n        }\n\n        .atendimento-numero {\n            font-size: 2em;\n            font-weight: bold;\n            color: #065f46;\n        }\n\n        .pessoa-info {\n            background: white;\n            padding: 12px;\n            border-radius: 8px;\n            margin-top: 10px;\n            font-size: 0.9em;\n        }\n\n        .pessoa-info strong {\n            color: #667eea;\n            display: block;\n            margin-bottom: 5px;\n        }\n\n        \/* Fila *\/\n        .fila-tabs {\n            display: flex;\n            gap: 5px;\n            margin-bottom: 15px;\n            flex-wrap: wrap;\n        }\n\n        .tab-btn {\n            padding: 10px 20px;\n            background: #e2e8f0;\n            border: none;\n            border-radius: 8px 8px 0 0;\n            cursor: pointer;\n            font-weight: bold;\n            color: #64748b;\n            transition: all 0.3s;\n        }\n\n        .tab-btn.active {\n            background: #667eea;\n            color: white;\n        }\n\n        .fila-container {\n            max-height: 400px;\n            overflow-y: auto;\n            padding-right: 10px;\n        }\n\n        .fila-item {\n            background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);\n            padding: 15px;\n            margin-bottom: 10px;\n            border-radius: 8px;\n            border-left: 4px solid;\n            transition: all 0.3s;\n        }\n\n        .fila-item:hover {\n            transform: translateX(5px);\n            box-shadow: 0 4px 10px rgba(0,0,0,0.1);\n        }\n\n        .fila-item.andamento { border-left-color: #3b82f6; }\n        .fila-item.andamento-pref { border-left-color: #8b5cf6; }\n        .fila-item.triagem { border-left-color: #10b981; }\n        .fila-item.triagem-pref { border-left-color: #14b8a6; }\n        .fila-item.entrega { border-left-color: #f59e0b; }\n        .fila-item.entrega-pref { border-left-color: #ef4444; }\n\n        .fila-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            margin-bottom: 8px;\n        }\n\n        .fila-numero {\n            font-size: 1.5em;\n            font-weight: bold;\n        }\n\n        .fila-badge {\n            padding: 6px 12px;\n            border-radius: 20px;\n            font-size: 0.8em;\n            font-weight: bold;\n            color: white;\n        }\n\n        .badge-andamento { background: #3b82f6; }\n        .badge-andamento-pref { background: #8b5cf6; }\n        .badge-triagem { background: #10b981; }\n        .badge-triagem-pref { background: #14b8a6; }\n        .badge-entrega { background: #f59e0b; }\n        .badge-entrega-pref { background: #ef4444; }\n\n        .fila-pessoa {\n            font-size: 0.9em;\n            color: #666;\n            margin-top: 5px;\n        }\n\n        .fila-pessoa strong {\n            color: #333;\n        }\n\n        \/* Estat\u00edsticas *\/\n        .stats-grid {\n            display: grid;\n            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n            gap: 15px;\n        }\n\n        .stat-card {\n            background: white;\n            padding: 20px;\n            border-radius: 12px;\n            text-align: center;\n            box-shadow: 0 4px 10px rgba(0,0,0,0.1);\n            transition: all 0.3s;\n        }\n\n        .stat-card:hover {\n            transform: translateY(-5px);\n            box-shadow: 0 8px 20px rgba(0,0,0,0.15);\n        }\n\n        .stat-numero {\n            font-size: 2.5em;\n            font-weight: bold;\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            -webkit-background-clip: text;\n            -webkit-text-fill-color: transparent;\n            background-clip: text;\n        }\n\n        .stat-label {\n            font-size: 0.9em;\n            color: #666;\n            margin-top: 5px;\n            font-weight: 600;\n        }\n\n        \/* Modal *\/\n        .modal {\n            display: none;\n            position: fixed;\n            z-index: 1000;\n            left: 0;\n            top: 0;\n            width: 100%;\n            height: 100%;\n            background: rgba(0,0,0,0.7);\n            backdrop-filter: blur(5px);\n        }\n\n        .modal-content {\n            background: white;\n            margin: 8% auto;\n            padding: 30px;\n            border-radius: 15px;\n            max-width: 500px;\n            box-shadow: 0 20px 60px rgba(0,0,0,0.5);\n            animation: slideDown 0.3s ease;\n        }\n\n        @keyframes slideDown {\n            from {\n                opacity: 0;\n                transform: translateY(-50px);\n            }\n            to {\n                opacity: 1;\n                transform: translateY(0);\n            }\n        }\n\n        .modal-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            margin-bottom: 25px;\n            padding-bottom: 15px;\n            border-bottom: 3px solid #667eea;\n        }\n\n        .modal-header h2 {\n            color: #667eea;\n            margin: 0;\n        }\n\n        .close {\n            color: #999;\n            font-size: 2em;\n            font-weight: bold;\n            cursor: pointer;\n            transition: all 0.3s;\n            line-height: 1;\n        }\n\n        .close:hover {\n            color: #ef4444;\n            transform: rotate(90deg);\n        }\n\n        .form-group {\n            margin-bottom: 20px;\n        }\n\n        .form-group label {\n            display: block;\n            margin-bottom: 8px;\n            color: #333;\n            font-weight: 600;\n        }\n\n        .form-group input {\n            width: 100%;\n            padding: 12px;\n            border: 2px solid #e2e8f0;\n            border-radius: 8px;\n            font-size: 1em;\n            transition: all 0.3s;\n        }\n\n        .form-group input:focus {\n            outline: none;\n            border-color: #667eea;\n            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);\n        }\n\n        .form-actions {\n            display: flex;\n            gap: 15px;\n            margin-top: 30px;\n        }\n\n        .btn-form {\n            flex: 1;\n            padding: 15px;\n            border: none;\n            border-radius: 8px;\n            font-size: 1.1em;\n            font-weight: bold;\n            cursor: pointer;\n            transition: all 0.3s;\n        }\n\n        .btn-salvar {\n            background: linear-gradient(135deg, #10b981 0%, #059669 100%);\n            color: white;\n        }\n\n        .btn-cancelar {\n            background: #e2e8f0;\n            color: #64748b;\n        }\n\n        .btn-form:hover {\n            transform: translateY(-2px);\n            box-shadow: 0 5px 15px rgba(0,0,0,0.2);\n        }\n\n        .fila-vazia {\n            text-align: center;\n            padding: 40px;\n            color: #94a3b8;\n            font-style: italic;\n        }\n\n        \/* Scroll customizado *\/\n        .fila-container::-webkit-scrollbar {\n            width: 10px;\n        }\n\n        .fila-container::-webkit-scrollbar-track {\n            background: #f1f1f1;\n            border-radius: 10px;\n        }\n\n        .fila-container::-webkit-scrollbar-thumb {\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            border-radius: 10px;\n        }\n\n        @media (max-width: 1200px) {\n            .main-grid {\n                grid-template-columns: 1fr;\n            }\n            \n            .atendimento-grid {\n                grid-template-columns: 1fr;\n            }\n        }\n\n        @media print {\n            body * {\n                visibility: hidden;\n            }\n            #relatorioImpressao, #relatorioImpressao * {\n                visibility: visible;\n            }\n            #relatorioImpressao {\n                position: absolute;\n                left: 0;\n                top: 0;\n                width: 100%;\n            }\n        }\n\n        \/* Estilos espec\u00edficos para quando \u00e9 painel *\/\n        .painel-mode {\n            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);\n            color: white;\n            padding: 0;\n        }\n\n        .painel-mode .container {\n            max-width: 100%;\n            margin: 0;\n            padding: 0;\n            height: 100vh;\n            display: flex;\n            flex-direction: column;\n        }\n\n        .painel-mode .header {\n            background: rgba(255, 255, 255, 0.1);\n            margin: 0;\n            border-radius: 0;\n            backdrop-filter: blur(10px);\n            border-bottom: 4px solid #10b981;\n            text-align: center;\n        }\n\n        .painel-mode .header h1 {\n            color: white;\n            font-size: 2.8em;\n            text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);\n        }\n\n        .painel-mode .header-controls {\n            display: none;\n        }\n\n        .painel-mode .main-grid {\n            grid-template-columns: 2fr 1fr;\n            flex: 1;\n            gap: 30px;\n            padding: 30px;\n            margin: 0;\n        }\n\n        .painel-mode .card {\n            background: rgba(255, 255, 255, 0.05);\n            backdrop-filter: blur(10px);\n            border: 2px solid rgba(16, 185, 129, 0.3);\n            color: white;\n        }\n\n        .painel-mode .card h2 {\n            color: #10b981;\n            border-bottom-color: rgba(16, 185, 129, 0.3);\n        }\n\n        \/* Estilos para chamadas no painel *\/\n        .painel-chamadas {\n            display: flex;\n            flex-direction: column;\n            gap: 20px;\n        }\n\n        .painel-chamada-card {\n            flex: 1;\n            background: rgba(255, 255, 255, 0.05);\n            border-radius: 25px;\n            padding: 40px;\n            backdrop-filter: blur(10px);\n            border: 2px solid rgba(16, 185, 129, 0.3);\n            display: flex;\n            flex-direction: column;\n            justify-content: center;\n            align-items: center;\n            text-align: center;\n        }\n\n        .painel-guiche-label {\n            font-size: 1.8em;\n            color: #94a3b8;\n            margin-bottom: 10px;\n            text-transform: uppercase;\n            letter-spacing: 3px;\n        }\n\n        .painel-especialidade {\n            font-size: 1.1em;\n            color: #64748b;\n            margin-bottom: 20px;\n            padding: 8px 20px;\n            background: rgba(100, 116, 139, 0.2);\n            border-radius: 20px;\n        }\n\n        .painel-senha {\n            font-size: 8em;\n            font-weight: bold;\n            color: #10b981;\n            text-shadow: 0 0 60px rgba(16, 185, 129, 0.8);\n            margin: 20px 0;\n            line-height: 1;\n        }\n\n        .painel-tipo {\n            font-size: 1.8em;\n            color: #cbd5e1;\n            margin-top: 15px;\n            padding: 15px 30px;\n            background: rgba(16, 185, 129, 0.2);\n            border-radius: 50px;\n        }\n\n        .painel-pessoa {\n            font-size: 1.4em;\n            color: #94a3b8;\n            margin-top: 15px;\n            max-width: 90%;\n        }\n\n        .painel-processo {\n            font-size: 1.2em;\n            color: #64748b;\n            margin-top: 10px;\n        }\n\n        .painel-aguardando {\n            opacity: 0.6;\n            text-align: center;\n            font-size: 1.8em;\n            color: #64748b;\n        }\n\n        @keyframes painelPulseGlow {\n            0%, 100% {\n                text-shadow: 0 0 60px rgba(16, 185, 129, 0.8),\n                             0 0 100px rgba(16, 185, 129, 0.6);\n                transform: scale(1);\n            }\n            50% {\n                text-shadow: 0 0 80px rgba(16, 185, 129, 1),\n                             0 0 120px rgba(16, 185, 129, 0.8);\n                transform: scale(1.02);\n            }\n        }\n\n        .painel-chamando {\n            animation: painelPulseGlow 2s infinite;\n        }\n\n        @keyframes painelSlideIn {\n            from {\n                opacity: 0;\n                transform: translateY(-50px);\n            }\n            to {\n                opacity: 1;\n                transform: translateY(0);\n            }\n        }\n\n        .painel-nova-chamada {\n            animation: painelSlideIn 0.8s ease;\n        }\n\n        \/* Painel footer com rel\u00f3gio *\/\n        .painel-footer {\n            background: rgba(255, 255, 255, 0.05);\n            padding: 20px;\n            text-align: center;\n            backdrop-filter: blur(10px);\n            border-top: 2px solid rgba(16, 185, 129, 0.3);\n        }\n\n        .painel-relogio {\n            font-size: 2em;\n            color: #10b981;\n            font-weight: bold;\n        }\n\n        .painel-data {\n            font-size: 1.1em;\n            color: #94a3b8;\n            margin-top: 5px;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\">\n        <div class=\"header\">\n            <h1>\ud83c\udfab Sistema de Senhas &#8211; Balc\u00e3o de Informa\u00e7\u00f5es<\/h1>\n            <div class=\"header-controls\">\n                <div class=\"status-indicator\">\n                    <div class=\"status-dot\"><\/div>\n                    <span style=\"font-weight: bold; color: #10b981;\">Sistema Online<\/span>\n                <\/div>\n                <button class=\"btn-header btn-painel\" onclick=\"abrirPainelJanela()\">\n                    \ud83d\udcfa Abrir Painel\n                <\/button>\n                <button class=\"btn-header btn-relatorio\" onclick=\"gerarRelatorio()\">\n                    \ud83d\udcca Relat\u00f3rio Di\u00e1rio\n                <\/button>\n                <button class=\"btn-header btn-limpar\" onclick=\"limparDados()\">\n                    \ud83d\uddd1\ufe0f Limpar Dados\n                <\/button>\n            <\/div>\n        <\/div>\n        \n        <div class=\"main-grid\">\n            <!-- Gerador de Senhas -->\n            <div class=\"card\">\n                <h2>\ud83c\udfaf Gerar Nova Senha<\/h2>\n                <div class=\"tipos-senha\">\n                    <button class=\"btn-tipo btn-andamento\" onclick=\"abrirModalSenha('andamento')\">\n                        <span class=\"icon\">\ud83d\udcdd<\/span>\n                        <span class=\"label\">Andamento<\/span>\n                        <span class=\"count\" id=\"count-andamento\">0<\/span>\n                    <\/button>\n                    <button class=\"btn-tipo btn-andamento-pref\" onclick=\"abrirModalSenha('andamento-pref')\">\n                        <span class=\"icon\">\u2b50<\/span>\n                        <span class=\"label\">Andamento Preferencial<\/span>\n                        <span class=\"count\" id=\"count-andamento-pref\">0<\/span>\n                    <\/button>\n                    <button class=\"btn-tipo btn-triagem\" onclick=\"abrirModalSenha('triagem')\">\n                        <span class=\"icon\">\ud83c\udfe5<\/span>\n                        <span class=\"label\">Triagem<\/span>\n                        <span class=\"count\" id=\"count-triagem\">0<\/span>\n                    <\/button>\n                    <button class=\"btn-tipo btn-triagem-pref\" onclick=\"abrirModalSenha('triagem-pref')\">\n                        <span class=\"icon\">\u2b50<\/span>\n                        <span class=\"label\">Triagem Preferencial<\/span>\n                        <span class=\"count\" id=\"count-triagem-pref\">0<\/span>\n                    <\/button>\n                    <button class=\"btn-tipo btn-entrega\" onclick=\"abrirModalSenha('entrega')\">\n                        <span class=\"icon\">\ud83d\udce6<\/span>\n                        <span class=\"label\">Entrega de Iniciais<\/span>\n                        <span class=\"count\" id=\"count-entrega\">0<\/span>\n                    <\/button>\n                    <button class=\"btn-tipo btn-entrega-pref\" onclick=\"abrirModalSenha('entrega-pref')\">\n                        <span class=\"icon\">\u2b50<\/span>\n                        <span class=\"label\">Entrega Preferencial<\/span>\n                        <span class=\"count\" id=\"count-entrega-pref\">0<\/span>\n                    <\/button>\n                <\/div>\n                \n                <div id=\"senhaGerada\" class=\"senha-gerada\" style=\"display: none;\">\n                    <p style=\"font-weight: bold; color: #333; font-size: 1.1em;\">\u2705 Senha Gerada!<\/p>\n                    <div class=\"senha-numero\" id=\"numeroSenha\"><\/div>\n                    <p class=\"senha-info\" id=\"infoSenha\"><\/p>\n                    <p class=\"senha-info\" id=\"nomePessoa\"><\/p>\n                    <p class=\"senha-info\" id=\"processoNumero\"><\/p>\n                    <p class=\"senha-info\" id=\"horaSenha\"><\/p>\n                    <button class=\"btn-imprimir\" onclick=\"imprimirSenha()\">\ud83d\udda8\ufe0f Imprimir Senha<\/button>\n                <\/div>\n            <\/div>\n\n            <!-- Painel de Atendimento -->\n            <div class=\"card\">\n                <h2>\ud83d\udc68\u200d\ud83d\udcbc Guich\u00eas de Atendimento<\/h2>\n                \n                <div class=\"atendimento-grid\">\n                    <!-- Guich\u00ea 1 - Apenas Entregas -->\n                    <div class=\"guiche-card\">\n                        <h3>\ud83c\udfe2 Guich\u00ea 1<\/h3>\n                        <div class=\"guiche-especialidade\">\n                            \ud83d\udce6 Especializado em: Entrega de Iniciais\n                        <\/div>\n                        <div class=\"controles-guiche\">\n                            <button class=\"btn-controle btn-chamar\" onclick=\"chamarProxima(1)\">\n                                \u25b6\ufe0f Chamar\n                            <\/button>\n                            <button class=\"btn-controle btn-rechamar\" onclick=\"rechamarSenha(1)\" id=\"btnRechamar1\" disabled>\n                                \ud83d\udd04 Rechamar\n                            <\/button>\n                            <button class=\"btn-controle btn-finalizar\" onclick=\"finalizarAtendimento(1)\" id=\"btnFinalizar1\" disabled>\n                                \u2705 Finalizar\n                            <\/button>\n                        <\/div>\n                        <div id=\"atendimento1\" style=\"display: none;\" class=\"atendimento-atual\">\n                            <div class=\"atendimento-numero\" id=\"senha1\"><\/div>\n                            <p class=\"senha-info\" id=\"tipo1\"><\/p>\n                            <div class=\"pessoa-info\" id=\"pessoa1\"><\/div>\n                        <\/div>\n                    <\/div>\n\n                    <!-- Guich\u00ea 2 - Andamento e Triagem -->\n                    <div class=\"guiche-card\">\n                        <h3>\ud83c\udfe2 Guich\u00ea 2<\/h3>\n                        <div class=\"guiche-especialidade\">\n                            \ud83d\udcdd Especializado em: Andamento e Triagem\n                        <\/div>\n                        <div class=\"controles-guiche\">\n                            <button class=\"btn-controle btn-chamar\" onclick=\"chamarProxima(2)\">\n                                \u25b6\ufe0f Chamar\n                            <\/button>\n                            <button class=\"btn-controle btn-rechamar\" onclick=\"rechamarSenha(2)\" id=\"btnRechamar2\" disabled>\n                                \ud83d\udd04 Rechamar\n                            <\/button>\n                            <button class=\"btn-controle btn-finalizar\" onclick=\"finalizarAtendimento(2)\" id=\"btnFinalizar2\" disabled>\n                                \u2705 Finalizar\n                            <\/button>\n                        <\/div>\n                        <div id=\"atendimento2\" style=\"display: none;\" class=\"atendimento-atual\">\n                            <div class=\"atendimento-numero\" id=\"senha2\"><\/div>\n                            <p class=\"senha-info\" id=\"tipo2\"><\/p>\n                            <div class=\"pessoa-info\" id=\"pessoa2\"><\/div>\n                        <\/div>\n                    <\/div>\n                <\/div>\n\n                <h3 style=\"color: #667eea; margin: 20px 0 10px 0;\">\ud83d\udcca Fila de Espera<\/h3>\n                <div class=\"fila-tabs\" id=\"filaTabs\"><\/div>\n                <div class=\"fila-container\" id=\"filaContainer\">\n                    <div class=\"fila-vazia\">Nenhuma senha na fila<\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Estat\u00edsticas -->\n        <div class=\"card\">\n            <h2>\ud83d\udcc8 Estat\u00edsticas do Sistema<\/h2>\n            <div class=\"stats-grid\">\n                <div class=\"stat-card\">\n                    <div class=\"stat-numero\" id=\"totalSenhas\">0<\/div>\n                    <div class=\"stat-label\">Total Gerado<\/div>\n                <\/div>\n                <div class=\"stat-card\">\n                    <div class=\"stat-numero\" id=\"totalAtendidas\">0<\/div>\n                    <div class=\"stat-label\">Atendidas<\/div>\n                <\/div>\n                <div class=\"stat-card\">\n                    <div class=\"stat-numero\" id=\"emEspera\">0<\/div>\n                    <div class=\"stat-label\">Em Espera<\/div>\n                <\/div>\n                <div class=\"stat-card\">\n                    <div class=\"stat-numero\" id=\"tempoMedio\">0min<\/div>\n                    <div class=\"stat-label\">Tempo M\u00e9dio<\/div>\n                <\/div>\n                <div class=\"stat-card\">\n                    <div class=\"stat-numero\" id=\"guiche1Total\">0<\/div>\n                    <div class=\"stat-label\">Guich\u00ea 1<\/div>\n                <\/div>\n                <div class=\"stat-card\">\n                    <div class=\"stat-numero\" id=\"guiche2Total\">0<\/div>\n                    <div class=\"stat-label\">Guich\u00ea 2<\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Footer com rel\u00f3gio (apenas no painel) -->\n        <div class=\"painel-footer\" style=\"display: none;\">\n            <div class=\"painel-relogio\" id=\"painelRelogio\"><\/div>\n            <div class=\"painel-data\" id=\"painelData\"><\/div>\n        <\/div>\n    <\/div>\n\n    <!-- Modal de Cadastro -->\n    <div id=\"modalCadastro\" class=\"modal\">\n        <div class=\"modal-content\">\n            <div class=\"modal-header\">\n                <h2>\ud83d\udc64 Cadastro da Senha<\/h2>\n                <span class=\"close\" onclick=\"fecharModalCadastro()\">&times;<\/span>\n            <\/div>\n            \n            <form id=\"formCadastro\" onsubmit=\"gerarSenhaComCadastro(event)\">\n                <input type=\"hidden\" id=\"tipoSenha\">\n                \n                <div class=\"form-group\">\n                    <label>Nome Completo *<\/label>\n                    <input type=\"text\" id=\"inputNome\" required placeholder=\"Digite o nome completo\">\n                <\/div>\n                \n                <div class=\"form-group\">\n                    <label>N\u00famero do Processo *<\/label>\n                    <input type=\"text\" id=\"inputProcesso\" required placeholder=\"Digite o n\u00famero do processo\">\n                <\/div>\n                \n                <div class=\"form-actions\">\n                    <button type=\"submit\" class=\"btn-form btn-salvar\">\u2705 Gerar Senha<\/button>\n                    <button type=\"button\" class=\"btn-form btn-cancelar\" onclick=\"fecharModalCadastro()\">\u274c Cancelar<\/button>\n                <\/div>\n            <\/form>\n        <\/div>\n    <\/div>\n\n    <!-- \u00c1rea de Impress\u00e3o de Relat\u00f3rio -->\n    <div id=\"relatorioImpressao\" style=\"display: none;\"><\/div>\n\n    <script>\n        \/\/ Verificar se \u00e9 modo painel\n        const urlParams = new URLSearchParams(window.location.search);\n        const isPainel = urlParams.get('painel') === 'true';\n\n        \/\/ Configura\u00e7\u00e3o dos tipos\n        const tiposConfig = {\n            'andamento': { prefixo: 'A', nome: 'Andamento', icon: '\ud83d\udcdd', guiche: 2 },\n            'andamento-pref': { prefixo: 'AP', nome: 'Andamento Preferencial', icon: '\u2b50', guiche: 2 },\n            'triagem': { prefixo: 'T', nome: 'Triagem', icon: '\ud83c\udfe5', guiche: 2 },\n            'triagem-pref': { prefixo: 'TP', nome: 'Triagem Preferencial', icon: '\u2b50', guiche: 2 },\n            'entrega': { prefixo: 'E', nome: 'Entrega de Iniciais', icon: '\ud83d\udce6', guiche: 1 },\n            'entrega-pref': { prefixo: 'EP', nome: 'Entrega Preferencial', icon: '\u2b50', guiche: 1 }\n        };\n\n        \/\/ Estado do sistema\n        let contadores = {\n            'andamento': 0,\n            'andamento-pref': 0,\n            'triagem': 0,\n            'triagem-pref': 0,\n            'entrega': 0,\n            'entrega-pref': 0\n        };\n        \n        let fila = [];\n        let guiches = {\n            1: { senhaAtual: null, ultimaChamada: null, totalAtendidas: 0 },\n            2: { senhaAtual: null, ultimaChamada: null, totalAtendidas: 0 }\n        };\n        let totalAtendidas = 0;\n        let senhasAtendidas = [];\n        let temposAtendimento = [];\n        let ultimaSenhaGerada = null;\n        let filtroAtivo = 'todos';\n        let dataInicioSistema = new Date();\n        let ultimaChamadaTimestamp = null;\n\n        \/\/ Se \u00e9 painel, configurar modo painel\n        if (isPainel) {\n            document.body.classList.add('painel-mode');\n            document.querySelector('.main-grid').innerHTML = `\n                <div class=\"painel-chamadas\">\n                    <div class=\"painel-chamada-card\" id=\"painelChamada1\">\n                        <div class=\"painel-aguardando\">\n                            <div class=\"painel-guiche-label\">GUICH\u00ca 1<\/div>\n                            <div class=\"painel-especialidade\">\ud83d\udce6 Entrega de Iniciais<\/div>\n                            <p>\ud83d\udd14 Aguardando pr\u00f3xima chamada...<\/p>\n                        <\/div>\n                    <\/div>\n                    \n                    <div class=\"painel-chamada-card\" id=\"painelChamada2\">\n                        <div class=\"painel-aguardando\">\n                            <div class=\"painel-guiche-label\">GUICH\u00ca 2<\/div>\n                            <div class=\"painel-especialidade\">\ud83d\udcdd Andamento e Triagem<\/div>\n                            <p>\ud83d\udd14 Aguardando pr\u00f3xima chamada...<\/p>\n                        <\/div>\n                    <\/div>\n                <\/div>\n\n                <div class=\"card\">\n                    <h2>\ud83d\udccb Pr\u00f3ximas Senhas<\/h2>\n                    <div id=\"painelProximasFila\"><\/div>\n                <\/div>\n            `;\n            \n            document.querySelector('.painel-footer').style.display = 'block';\n            document.querySelector('.card:last-child').style.display = 'none'; \/\/ Esconder estat\u00edsticas\n        }\n\n        \/\/ LocalStorage\n        function salvarEstado() {\n            const estado = {\n                contadores,\n                fila,\n                guiches,\n                totalAtendidas,\n                senhasAtendidas,\n                temposAtendimento,\n                dataInicioSistema,\n                timestamp: Date.now()\n            };\n            localStorage.setItem('sistemasenhas', JSON.stringify(estado));\n        }\n\n        function carregarEstado() {\n            const saved = localStorage.getItem('sistemasenhas');\n            if (saved) {\n                const estado = JSON.parse(saved);\n                contadores = estado.contadores || contadores;\n                fila = (estado.fila || []).map(s => ({\n                    ...s, \n                    horario: new Date(s.horario)\n                }));\n                guiches = estado.guiches || guiches;\n                totalAtendidas = estado.totalAtendidas || 0;\n                senhasAtendidas = (estado.senhasAtendidas || []).map(s => ({\n                    ...s,\n                    horario: new Date(s.horario),\n                    horaAtendimento: s.horaAtendimento ? new Date(s.horaAtendimento) : null,\n                    horaFinalizacao: s.horaFinalizacao ? new Date(s.horaFinalizacao) : null\n                }));\n                temposAtendimento = estado.temposAtendimento || [];\n                dataInicioSistema = estado.dataInicioSistema ? new Date(estado.dataInicioSistema) : new Date();\n            }\n        }\n\n        \/\/ Modal de cadastro (apenas se n\u00e3o for painel)\n        function abrirModalSenha(tipo) {\n            if (isPainel) return;\n            \n            document.getElementById('tipoSenha').value = tipo;\n            document.getElementById('modalCadastro').style.display = 'block';\n            document.getElementById('inputNome').focus();\n            \n            const config = tiposConfig[tipo];\n            document.querySelector('#modalCadastro .modal-header h2').textContent = \n                `\ud83d\udc64 Cadastro - ${config.icon} ${config.nome}`;\n        }\n\n        function fecharModalCadastro() {\n            if (isPainel) return;\n            \n            document.getElementById('modalCadastro').style.display = 'none';\n            document.getElementById('formCadastro').reset();\n        }\n\n        \/\/ Gerar senha com cadastro (apenas se n\u00e3o for painel)\n        function gerarSenhaComCadastro(event) {\n            if (isPainel) return;\n            \n            event.preventDefault();\n            \n            const tipo = document.getElementById('tipoSenha').value;\n            contadores[tipo]++;\n            \n            const config = tiposConfig[tipo];\n            const numero = contadores[tipo].toString().padStart(3, '0');\n            const senhaCompleta = `${config.prefixo}${numero}`;\n            \n            const novaSenha = {\n                numero: senhaCompleta,\n                tipo: tipo,\n                tipoNome: config.nome,\n                horario: new Date(),\n                status: 'aguardando',\n                guicheDestino: config.guiche,\n                nome: document.getElementById('inputNome').value,\n                processo: document.getElementById('inputProcesso').value\n            };\n            \n            fila.push(novaSenha);\n            ultimaSenhaGerada = novaSenha;\n            \n            \/\/ Exibir senha gerada\n            document.getElementById('numeroSenha').textContent = senhaCompleta;\n            document.getElementById('infoSenha').textContent = `${config.icon} ${config.nome}`;\n            document.getElementById('nomePessoa').textContent = `\ud83d\udc64 ${novaSenha.nome}`;\n            document.getElementById('processoNumero').textContent = `\ud83d\udccb Processo: ${novaSenha.processo}`;\n            document.getElementById('horaSenha').textContent = `\ud83d\udcc5 ${formatarDataHora(novaSenha.horario)}`;\n            document.getElementById('senhaGerada').style.display = 'block';\n            \n            fecharModalCadastro();\n            salvarEstado();\n            atualizarInterface();\n            tocarSom('gerar');\n        }\n\n        \/\/ Chamar pr\u00f3xima (apenas se n\u00e3o for painel)\n        function chamarProxima(guiche) {\n            if (isPainel) return;\n            \n            \/\/ Filtrar senhas do guich\u00ea espec\u00edfico\n            const senhasDoGuiche = fila.filter(s => s.guicheDestino === guiche);\n            \n            if (senhasDoGuiche.length === 0) {\n                const especialidade = guiche === 1 ? 'Entrega de Iniciais' : 'Andamento e Triagem';\n                alert(`\u26a0\ufe0f N\u00e3o h\u00e1 senhas de ${especialidade} na fila para o Guich\u00ea ${guiche}!`);\n                return;\n            }\n\n            if (guiches[guiche].senhaAtual) {\n                finalizarAtendimento(guiche, false);\n            }\n\n            \/\/ Priorizar preferenciais do guich\u00ea espec\u00edfico\n            let indiceSenha = fila.findIndex(s => \n                s.guicheDestino === guiche && s.tipo.includes('pref')\n            );\n            \n            if (indiceSenha === -1) {\n                \/\/ Pegar primeira senha do guich\u00ea\n                indiceSenha = fila.findIndex(s => s.guicheDestino === guiche);\n            }\n\n            const senha = fila.splice(indiceSenha, 1)[0];\n            senha.horaChamada = new Date();\n            senha.guiche = guiche;\n            \n            guiches[guiche].senhaAtual = senha;\n            guiches[guiche].ultimaChamada = {...senha};\n            \n            document.getElementById(`btnRechamar${guiche}`).disabled = false;\n            document.getElementById(`btnFinalizar${guiche}`).disabled = false;\n            \n            salvarEstado();\n            atualizarInterface();\n            tocarSom('chamar');\n            \n            \/\/ Atualizar timestamp para o painel\n            ultimaChamadaTimestamp = Date.now();\n            localStorage.setItem('novachamada', JSON.stringify({\n                senha: senha,\n                guiche: guiche,\n                timestamp: ultimaChamadaTimestamp\n            }));\n        }\n\n        \/\/ Rechamar (apenas se n\u00e3o for painel)\n        function rechamarSenha(guiche) {\n            if (isPainel) return;\n            \n            if (guiches[guiche].ultimaChamada) {\n                ultimaChamadaTimestamp = Date.now();\n                localStorage.setItem('novachamada', JSON.stringify({\n                    senha: guiches[guiche].ultimaChamada,\n                    guiche: guiche,\n                    timestamp: ultimaChamadaTimestamp\n                }));\n                tocarSom('chamar');\n            }\n        }\n\n        \/\/ Finalizar atendimento (apenas se n\u00e3o for painel)\n        function finalizarAtendimento(guiche, manual = true) {\n            if (isPainel) return;\n            \n            const senha = guiches[guiche].senhaAtual;\n            if (senha) {\n                senha.horaFinalizacao = new Date();\n                const tempoAtendimento = Math.floor((senha.horaFinalizacao - senha.horario.getTime()) \/ 1000 \/ 60);\n                temposAtendimento.push(tempoAtendimento);\n                senha.tempoAtendimento = tempoAtendimento;\n                senha.status = 'atendida';\n                \n                senhasAtendidas.push(senha);\n                totalAtendidas++;\n                guiches[guiche].totalAtendidas++;\n                guiches[guiche].senhaAtual = null;\n                \n                if (manual) {\n                    document.getElementById(`atendimento${guiche}`).style.display = 'none';\n                    document.getElementById(`btnFinalizar${guiche}`).disabled = true;\n                    tocarSom('finalizar');\n                }\n                \n                salvarEstado();\n                atualizarInterface();\n            }\n        }\n\n        \/\/ Atualizar interface\n        function atualizarInterface() {\n            if (isPainel) {\n                atualizarPainel();\n                return;\n            }\n\n            \/\/ Contadores\n            Object.keys(contadores).forEach(tipo => {\n                const countElement = document.getElementById(`count-${tipo}`);\n                if (countElement) {\n                    countElement.textContent = contadores[tipo];\n                }\n            });\n\n            \/\/ Estat\u00edsticas\n            const totalGerado = Object.values(contadores).reduce((a, b) => a + b, 0);\n            document.getElementById('totalSenhas').textContent = totalGerado;\n            document.getElementById('totalAtendidas').textContent = totalAtendidas;\n            document.getElementById('emEspera').textContent = fila.length;\n            document.getElementById('guiche1Total').textContent = guiches[1].totalAtendidas;\n            document.getElementById('guiche2Total').textContent = guiches[2].totalAtendidas;\n            \n            const tempoMedio = temposAtendimento.length > 0 \n                ? Math.round(temposAtendimento.reduce((a, b) => a + b, 0) \/ temposAtendimento.length)\n                : 0;\n            document.getElementById('tempoMedio').textContent = `${tempoMedio}min`;\n\n            \/\/ Guich\u00eas\n            [1, 2].forEach(g => {\n                if (guiches[g].senhaAtual) {\n                    const senha = guiches[g].senhaAtual;\n                    document.getElementById(`senha${g}`).textContent = senha.numero;\n                    document.getElementById(`tipo${g}`).textContent = `${tiposConfig[senha.tipo].icon} ${senha.tipoNome}`;\n                    document.getElementById(`pessoa${g}`).innerHTML = `\n                        <strong>\ud83d\udc64 ${senha.nome}<\/strong>\n                        \ud83d\udccb Processo: ${senha.processo}\n                    `;\n                    document.getElementById(`atendimento${g}`).style.display = 'block';\n                }\n            });\n\n            atualizarTabs();\n            atualizarFila();\n        }\n\n        \/\/ Atualizar painel\n        function atualizarPainel() {\n            if (!isPainel) return;\n\n            \/\/ Verificar nova chamada\n            const novaChamadaStr = localStorage.getItem('novachamada');\n            if (novaChamadaStr) {\n                const novaChamada = JSON.parse(novaChamadaStr);\n                if (novaChamada.timestamp !== ultimaChamadaTimestamp) {\n                    ultimaChamadaTimestamp = novaChamada.timestamp;\n                    exibirChamadaPainel(novaChamada.senha, novaChamada.guiche);\n                    tocarSomChamadaPainel();\n                }\n            }\n\n            \/\/ Atualizar pr\u00f3ximas senhas\n            atualizarProximasPainel();\n\n            \/\/ Atualizar rel\u00f3gio\n            const agora = new Date();\n            document.getElementById('painelRelogio').textContent = agora.toLocaleTimeString('pt-BR');\n            document.getElementById('painelData').textContent = agora.toLocaleDateString('pt-BR', {\n                weekday: 'long',\n                day: '2-digit',\n                month: 'long',\n                year: 'numeric'\n            });\n        }\n\n        function atualizarProximasPainel() {\n            if (!isPainel) return;\n\n            const proximasFila = document.getElementById('painelProximasFila');\n            if (fila.length === 0) {\n                proximasFila.innerHTML = '<div class=\"fila-vazia\">Nenhuma senha aguardando<\/div>';\n                return;\n            }\n\n            const proximas = fila.slice(0, 8);\n            proximasFila.innerHTML = proximas.map(senha => {\n                const config = tiposConfig[senha.tipo];\n                return `\n                    <div class=\"fila-item ${senha.tipo}\">\n                        <div class=\"fila-header\">\n                            <div class=\"fila-numero\">${senha.numero}<\/div>\n                            <span class=\"fila-badge badge-${senha.tipo}\">\n                                ${config.icon} G${senha.guicheDestino}\n                            <\/span>\n                        <\/div>\n                        <div class=\"fila-pessoa\">\n                            <strong>\ud83d\udc64 ${senha.nome}<\/strong><br>\n                            \ud83d\udccb ${senha.processo}\n                        <\/div>\n                    <\/div>\n                `;\n            }).join('');\n        }\n\n        function exibirChamadaPainel(senha, guiche) {\n            if (!isPainel) return;\n\n            const config = tiposConfig[senha.tipo];\n            const especialidade = guiche === 1 ? '\ud83d\udce6 Entrega de Iniciais' : '\ud83d\udcdd Andamento e Triagem';\n            const chamadaDiv = document.getElementById(`painelChamada${guiche}`);\n            chamadaDiv.innerHTML = `\n                <div class=\"painel-nova-chamada\">\n                    <div class=\"painel-guiche-label\">GUICH\u00ca ${guiche}<\/div>\n                    <div class=\"painel-especialidade\">${especialidade}<\/div>\n                    <div class=\"painel-senha painel-chamando\">${senha.numero}<\/div>\n                    <div class=\"painel-tipo\">\n                        ${config.icon} ${config.nome.toUpperCase()}\n                    <\/div>\n                    <div class=\"painel-pessoa\">\n                        \ud83d\udc64 ${senha.nome}\n                    <\/div>\n                    <div class=\"painel-processo\">\n                        \ud83d\udccb ${senha.processo}\n                    <\/div>\n                <\/div>\n            `;\n        }\n\n        \/\/ Tabs (apenas se n\u00e3o for painel)\n        function atualizarTabs() {\n            if (isPainel) return;\n\n            const tabs = ['todos', 'guiche1', 'guiche2'];\n            const tabsHTML = tabs.map(tab => {\n                let count, label;\n                \n                if (tab === 'todos') {\n                    count = fila.length;\n                    label = 'Todas';\n                } else if (tab === 'guiche1') {\n                    count = fila.filter(s => s.guicheDestino === 1).length;\n                    label = 'Guich\u00ea 1 (Entregas)';\n                } else {\n                    count = fila.filter(s => s.guicheDestino === 2).length;\n                    label = 'Guich\u00ea 2 (And.\/Triagem)';\n                }\n                \n                return `\n                    <button class=\"tab-btn ${filtroAtivo === tab ? 'active' : ''}\" \n                            onclick=\"filtrarFila('${tab}')\">\n                        ${label} (${count})\n                    <\/button>\n                `;\n            }).join('');\n            \n            const filaTabsElement = document.getElementById('filaTabs');\n            if (filaTabsElement) {\n                filaTabsElement.innerHTML = tabsHTML;\n            }\n        }\n\n        function filtrarFila(tipo) {\n            if (isPainel) return;\n            \n            filtroAtivo = tipo;\n            atualizarFila();\n            atualizarTabs();\n        }\n\n        \/\/ Fila (apenas se n\u00e3o for painel)\n        function atualizarFila() {\n            if (isPainel) return;\n\n            let filaFiltrada = fila;\n            \n            if (filtroAtivo === 'guiche1') {\n                filaFiltrada = fila.filter(s => s.guicheDestino === 1);\n            } else if (filtroAtivo === 'guiche2') {\n                filaFiltrada = fila.filter(s => s.guicheDestino === 2);\n            }\n            \n            const container = document.getElementById('filaContainer');\n            if (!container) return;\n            \n            if (filaFiltrada.length === 0) {\n                container.innerHTML = '<div class=\"fila-vazia\">\ud83d\udced Nenhuma senha na fila<\/div>';\n            } else {\n                container.innerHTML = filaFiltrada.map(senha => {\n                    const tempoEspera = Math.floor((Date.now() - senha.horario.getTime()) \/ 1000 \/ 60);\n                    const config = tiposConfig[senha.tipo];\n                    return `\n                        <div class=\"fila-item ${senha.tipo}\">\n                            <div class=\"fila-header\">\n                                <div class=\"fila-numero\">${senha.numero}<\/div>\n                                <span class=\"fila-badge badge-${senha.tipo}\">\n                                    ${config.icon} ${config.nome}\n                                <\/span>\n                            <\/div>\n                            <div class=\"fila-pessoa\">\n                                <strong>\ud83d\udc64 ${senha.nome}<\/strong><br>\n                                \ud83d\udccb ${senha.processo} | \ud83c\udfe2 Guich\u00ea ${senha.guicheDestino} | \ud83d\udd50 ${formatarHora(senha.horario)} (${tempoEspera}min)\n                            <\/div>\n                        <\/div>\n                    `;\n                }).join('');\n            }\n        }\n\n        \/\/ Abrir painel em nova janela\n        function abrirPainelJanela() {\n            if (isPainel) return;\n            \n            const url = window.location.href + '?painel=true';\n            window.open(url, 'PainelSenhas', 'fullscreen=yes,location=no,menubar=no,toolbar=no,status=no,scrollbars=no');\n        }\n\n        \/\/ Formata\u00e7\u00e3o\n        function formatarDataHora(data) {\n            return data.toLocaleString('pt-BR', { \n                day: '2-digit', month: '2-digit', year: 'numeric',\n                hour: '2-digit', minute: '2-digit'\n            });\n        }\n\n        function formatarHora(data) {\n            return data.toLocaleTimeString('pt-BR', { hour: '2-digit', minute: '2-digit' });\n        }\n\n        function formatarData(data) {\n            return data.toLocaleDateString('pt-BR');\n        }\n\n        \/\/ Imprimir senha (apenas se n\u00e3o for painel)\n        function imprimirSenha() {\n            if (isPainel || !ultimaSenhaGerada) return;\n            \n            const config = tiposConfig[ultimaSenhaGerada.tipo];\n            const printWindow = window.open('', '', 'width=300,height=600');\n            printWindow.document.write(`\n                <!DOCTYPE html>\n                <html>\n                <head>\n                    <title>Senha - ${ultimaSenhaGerada.numero}<\/title>\n                    <style>\n                        body { font-family: Arial, sans-serif; text-align: center; padding: 15px; }\n                        .ticket { border: 2px dashed #333; padding: 20px; }\n                        .numero { font-size: 60px; font-weight: bold; margin: 20px 0; }\n                        .info { font-size: 14px; margin: 10px 0; }\n                        .linha { border-top: 1px dashed #999; margin: 15px 0; }\n                        .destaque { background: #f0f4ff; padding: 10px; border-radius: 5px; margin: 10px 0; }\n                    <\/style>\n                <\/head>\n                <body>\n                    <div class=\"ticket\">\n                        <h2>\ud83c\udfe2 Balc\u00e3o de Informa\u00e7\u00f5es<\/h2>\n                        <div class=\"numero\">${ultimaSenhaGerada.numero}<\/div>\n                        <div class=\"info\"><strong>${config.icon} ${config.nome}<\/strong><\/div>\n                        <div class=\"linha\"><\/div>\n                        <div class=\"info\"><strong>Nome:<\/strong> ${ultimaSenhaGerada.nome}<\/div>\n                        <div class=\"info\"><strong>Processo:<\/strong> ${ultimaSenhaGerada.processo}<\/div>\n                        <div class=\"linha\"><\/div>\n                        <div class=\"destaque\">\n                            <strong>\ud83c\udfe2 Aguarde ser chamado no<br>GUICH\u00ca ${ultimaSenhaGerada.guicheDestino}<\/strong>\n                        <\/div>\n                        <div class=\"linha\"><\/div>\n                        <div class=\"info\">\ud83d\udcc5 ${formatarDataHora(ultimaSenhaGerada.horario)}<\/div>\n                        <p style=\"margin-top: 20px; font-size: 12px;\">Acompanhe o painel de chamadas<\/p>\n                    <\/div>\n                <\/body>\n                <\/html>\n            `);\n            printWindow.document.close();\n            printWindow.print();\n        }\n\n        \/\/ Gerar Relat\u00f3rio (apenas se n\u00e3o for painel)\n        function gerarRelatorio() {\n            if (isPainel) return;\n            \n            const hoje = new Date();\n            const totalGerado = Object.values(contadores).reduce((a, b) => a + b, 0);\n            const tempoMedio = temposAtendimento.length > 0 \n                ? Math.round(temposAtendimento.reduce((a, b) => a + b, 0) \/ temposAtendimento.length)\n                : 0;\n\n            let html = `\n                <!DOCTYPE html>\n                <html>\n                <head>\n                    <title>Relat\u00f3rio Di\u00e1rio - ${formatarData(hoje)}<\/title>\n                    <style>\n                        body { font-family: Arial, sans-serif; padding: 30px; }\n                        h1 { color: #667eea; border-bottom: 3px solid #667eea; padding-bottom: 10px; }\n                        .info { margin: 20px 0; }\n                        .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 20px 0; }\n                        .stat-box { background: #f0f4ff; padding: 15px; border-radius: 8px; text-align: center; }\n                        .stat-numero { font-size: 2em; font-weight: bold; color: #667eea; }\n                        .stat-label { color: #666; margin-top: 5px; }\n                        table { width: 100%; border-collapse: collapse; margin: 20px 0; }\n                        th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }\n                        th { background: #667eea; color: white; }\n                        tr:nth-child(even) { background: #f9fafb; }\n                        .rodape { margin-top: 30px; padding-top: 20px; border-top: 2px solid #667eea; text-align: center; color: #666; }\n                        .guiche-section { margin: 30px 0; padding: 20px; background: #f8fafc; border-radius: 10px; }\n                    <\/style>\n                <\/head>\n                <body>\n                    <h1>\ud83d\udcca Relat\u00f3rio Di\u00e1rio - Balc\u00e3o de Informa\u00e7\u00f5es<\/h1>\n                    \n                    <div class=\"info\">\n                        <p><strong>Data do Relat\u00f3rio:<\/strong> ${formatarDataHora(hoje)}<\/p>\n                        <p><strong>Per\u00edodo:<\/strong> ${formatarDataHora(dataInicioSistema)} at\u00e9 ${formatarDataHora(hoje)}<\/p>\n                    <\/div>\n\n                    <h2>\ud83d\udcc8 Resumo Geral<\/h2>\n                    <div class=\"stats\">\n                        <div class=\"stat-box\">\n                            <div class=\"stat-numero\">${totalGerado}<\/div>\n                            <div class=\"stat-label\">Total Gerado<\/div>\n                        <\/div>\n                        <div class=\"stat-box\">\n                            <div class=\"stat-numero\">${totalAtendidas}<\/div>\n                            <div class=\"stat-label\">Total Atendidas<\/div>\n                        <\/div>\n                        <div class=\"stat-box\">\n                            <div class=\"stat-numero\">${tempoMedio}min<\/div>\n                            <div class=\"stat-label\">Tempo M\u00e9dio<\/div>\n                        <\/div>\n                    <\/div>\n\n                    <div class=\"guiche-section\">\n                        <h3>\ud83c\udfe2 Guich\u00ea 1 - Entrega de Iniciais<\/h3>\n                        <p><strong>Total Atendido:<\/strong> ${guiches[1].totalAtendidas} senhas<\/p>\n                    <\/div>\n\n                    <div class=\"guiche-section\">\n                        <h3>\ud83c\udfe2 Guich\u00ea 2 - Andamento e Triagem<\/h3>\n                        <p><strong>Total Atendido:<\/strong> ${guiches[2].totalAtendidas} senhas<\/p>\n                    <\/div>\n\n                    <h2>\ud83d\udccb Senhas por Tipo<\/h2>\n                    <table>\n                        <thead>\n                            <tr>\n                                <th>Tipo de Atendimento<\/th>\n                                <th>Guich\u00ea<\/th>\n                                <th>Quantidade<\/th>\n                                <th>Porcentagem<\/th>\n                            <\/tr>\n                        <\/thead>\n                        <tbody>\n            `;\n\n            Object.keys(tiposConfig).forEach(tipo => {\n                const config = tiposConfig[tipo];\n                const qtd = contadores[tipo];\n                const perc = totalGerado > 0 ? ((qtd \/ totalGerado) * 100).toFixed(1) : 0;\n                html += `\n                    <tr>\n                        <td>${config.icon} ${config.nome}<\/td>\n                        <td>Guich\u00ea ${config.guiche}<\/td>\n                        <td>${qtd}<\/td>\n                        <td>${perc}%<\/td>\n                    <\/tr>\n                `;\n            });\n\n            html += `\n                        <\/tbody>\n                    <\/table>\n\n                    <h2>\u2705 Senhas Atendidas (Detalhamento)<\/h2>\n                    <table>\n                        <thead>\n                            <tr>\n                                <th>Senha<\/th>\n                                <th>Nome<\/th>\n                                <th>Processo<\/th>\n                                <th>Tipo<\/th>\n                                <th>Guich\u00ea<\/th>\n                                <th>Hora Finaliza\u00e7\u00e3o<\/th>\n                                <th>Tempo<\/th>\n                            <\/tr>\n                        <\/thead>\n                        <tbody>\n            `;\n\n            senhasAtendidas.forEach(senha => {\n                html += `\n                    <tr>\n                        <td><strong>${senha.numero}<\/strong><\/td>\n                        <td>${senha.nome}<\/td>\n                        <td>${senha.processo}<\/td>\n                        <td>${tiposConfig[senha.tipo].nome}<\/td>\n                        <td>Guich\u00ea ${senha.guiche}<\/td>\n                        <td>${formatarHora(senha.horaFinalizacao)}<\/td>\n                        <td>${senha.tempoAtendimento}min<\/td>\n                    <\/tr>\n                `;\n            });\n\n            html += `\n                        <\/tbody>\n                    <\/table>\n\n                    <div class=\"rodape\">\n                        <p><strong>Sistema de Senhas - Balc\u00e3o de Informa\u00e7\u00f5es<\/strong><\/p>\n                        <p>Relat\u00f3rio gerado automaticamente em ${formatarDataHora(hoje)}<\/p>\n                        <p>Total de p\u00e1ginas: 1 | Documento v\u00e1lido sem assinatura<\/p>\n                    <\/div>\n                <\/body>\n                <\/html>\n            `;\n\n            const printWindow = window.open('', '', 'width=900,height=700');\n            printWindow.document.write(html);\n            printWindow.document.close();\n            printWindow.print();\n        }\n\n        \/\/ Limpar dados (apenas se n\u00e3o for painel)\n        function limparDados() {\n            if (isPainel) return;\n            \n            if (confirm('\u26a0\ufe0f Deseja realmente limpar todos os dados do sistema?\\n\\nEsta a\u00e7\u00e3o n\u00e3o pode ser desfeita!')) {\n                if (confirm('\ud83d\udd12 Confirma\u00e7\u00e3o final: Todos os dados ser\u00e3o apagados. Continuar?')) {\n                    localStorage.clear();\n                    location.reload();\n                }\n            }\n        }\n\n        \/\/ Sons\n        function tocarSom(tipo) {\n            const audioContext = new (window.AudioContext || window.webkitAudioContext)();\n            const oscillator = audioContext.createOscillator();\n            const gainNode = audioContext.createGain();\n            \n            oscillator.connect(gainNode);\n            gainNode.connect(audioContext.destination);\n            \n            if (tipo === 'chamar') {\n                oscillator.frequency.value = 800;\n                gainNode.gain.setValueAtTime(0.3, audioContext.currentTime);\n                oscillator.start(audioContext.currentTime);\n                oscillator.stop(audioContext.currentTime + 0.15);\n                \n                setTimeout(() => {\n                    const osc2 = audioContext.createOscillator();\n                    osc2.connect(gainNode);\n                    osc2.frequency.value = 1000;\n                    osc2.start(audioContext.currentTime);\n                    osc2.stop(audioContext.currentTime + 0.15);\n                }, 200);\n                \n                setTimeout(() => {\n                    const osc3 = audioContext.createOscillator();\n                    osc3.connect(gainNode);\n                    osc3.frequency.value = 1200;\n                    osc3.start(audioContext.currentTime);\n                    osc3.stop(audioContext.currentTime + 0.3);\n                }, 400);\n            } else if (tipo === 'gerar') {\n                oscillator.frequency.value = 600;\n                gainNode.gain.setValueAtTime(0.2, audioContext.currentTime);\n                oscillator.start(audioContext.currentTime);\n                oscillator.stop(audioContext.currentTime + 0.1);\n            } else if (tipo === 'finalizar') {\n                oscillator.frequency.value = 400;\n                gainNode.gain.setValueAtTime(0.2, audioContext.currentTime);\n                oscillator.start(audioContext.currentTime);\n                oscillator.stop(audioContext.currentTime + 0.1);\n            }\n        }\n\n        function tocarSomChamadaPainel() {\n            tocarSom('chamar');\n        }\n\n        \/\/ Fechar modal ao clicar fora (apenas se n\u00e3o for painel)\n        window.onclick = function(event) {\n            if (isPainel) return;\n            \n            const modal = document.getElementById('modalCadastro');\n            if (event.target === modal) {\n                fecharModalCadastro();\n            }\n        }\n\n        \/\/ Inicializar\n        carregarEstado();\n        atualizarInterface();\n        \n        \/\/ Atualizar interface periodicamente\n        setInterval(atualizarInterface, 1000);\n    <\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>Sistema de Senhas &#8211; Balc\u00e3o de Informa\u00e7\u00f5es \ud83c\udfab Sistema de Senhas &#8211; Balc\u00e3o de Informa\u00e7\u00f5es Sistema Online \ud83d\udcfa Abrir Painel \ud83d\udcca Relat\u00f3rio Di\u00e1rio \ud83d\uddd1\ufe0f Limpar Dados \ud83c\udfaf Gerar Nova Senha \ud83d\udcdd Andamento 0 \u2b50 Andamento Preferencial 0 \ud83c\udfe5 Triagem 0 \u2b50 Triagem Preferencial 0 \ud83d\udce6 Entrega de Iniciais 0 \u2b50 Entrega Preferencial 0 \u2705 Senha [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"Sistema de Senhas - Balc\u00e3o de Informa\u00e7\u00f5es\n    \n\n\n    \n        \n            \ud83c\udfab Sistema de Senhas - Balc\u00e3o de Informa\u00e7\u00f5es\n            \n                \n                    \n                    Sistema Online\n                \n                \n                    \ud83d\udcfa Abrir Painel\n                \n                \n                    \ud83d\udcca Relat\u00f3rio Di\u00e1rio\n                \n                \n                    \ud83d\uddd1\ufe0f Limpar Dados\n                \n            \n        \n        \n        \n            \n            \n                \ud83c\udfaf Gerar Nova Senha\n                \n                    \n                        \ud83d\udcdd\n                        Andamento\n                        0\n                    \n                    \n                        \u2b50\n                        Andamento Preferencial\n                        0\n                    \n                    \n                        \ud83c\udfe5\n                        Triagem\n                        0\n                    \n                    \n                        \u2b50\n                        Triagem Preferencial\n                        0\n                    \n                    \n                        \ud83d\udce6\n                        Entrega de Iniciais\n                        0\n                    \n                    \n                        \u2b50\n                        Entrega Preferencial\n                        0\n                    \n                \n                \n                \n                    \u2705 Senha Gerada!\n                    \n                    \n                    \n                    \n                    \n                    \ud83d\udda8\ufe0f Imprimir Senha\n                \n            \n\n            \n            \n                \ud83d\udc68\u200d\ud83d\udcbc Guich\u00eas de Atendimento\n                \n                \n                    \n                    \n                        \ud83c\udfe2 Guich\u00ea 1\n                        \n                            \ud83d\udce6 Especializado em: Entrega de Iniciais\n                        \n                        \n                            \n                                \u25b6\ufe0f Chamar\n                            \n                            \n                                \ud83d\udd04 Rechamar\n                            \n                            \n                                \u2705 Finalizar\n                            \n                        \n                        \n                            \n                            \n                            \n                        \n                    \n\n                    \n                    \n                        \ud83c\udfe2 Guich\u00ea 2\n                        \n                            \ud83d\udcdd Especializado em: Andamento e Triagem\n                        \n                        \n                            \n                                \u25b6\ufe0f Chamar\n                            \n                            \n                                \ud83d\udd04 Rechamar\n                            \n                            \n                                \u2705 Finalizar\n                            \n                        \n                        \n                            \n                            \n                            \n                        \n                    \n                \n\n                \ud83d\udcca Fila de Espera\n                \n                \n                    Nenhuma senha na fila\n                \n            \n        \n\n        \n        \n            \ud83d\udcc8 Estat\u00edsticas do Sistema\n            \n                \n                    0\n                    Total Gerado\n                \n                \n                    0\n                    Atendidas\n                \n                \n                    0\n                    Em Espera\n                \n                \n                    0min\n                    Tempo M\u00e9dio\n                \n                \n                    0\n                    Guich\u00ea 1\n                \n                \n                    0\n                    Guich\u00ea 2\n                \n            \n        \n    \n\n    \n    \n        \n            \n                \ud83d\udc64 Cadastro da Senha\n                times;\n            \n            \n            \n                \n                \n                \n                    Nome Completo *\n                    \n                \n                \n                \n                    N\u00famero do Processo *\n                    \n                \n                \n                \n                    \u2705 Gerar Senha\n                    \u274c Cancelar","footnotes":""},"class_list":["post-1090","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_hostinger_reach_plugin_has_subscription_block":false,"_hostinger_reach_plugin_is_elementor":false,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"vini.v8@gmail.com","author_link":"https:\/\/jecoz12.com.br\/?author=1"},"uagb_comment_info":0,"uagb_excerpt":"Sistema de Senhas &#8211; Balc\u00e3o de Informa\u00e7\u00f5es \ud83c\udfab Sistema de Senhas &#8211; Balc\u00e3o de Informa\u00e7\u00f5es Sistema Online \ud83d\udcfa Abrir Painel \ud83d\udcca Relat\u00f3rio Di\u00e1rio \ud83d\uddd1\ufe0f Limpar Dados \ud83c\udfaf Gerar Nova Senha \ud83d\udcdd Andamento 0 \u2b50 Andamento Preferencial 0 \ud83c\udfe5 Triagem 0 \u2b50 Triagem Preferencial 0 \ud83d\udce6 Entrega de Iniciais 0 \u2b50 Entrega Preferencial 0 \u2705 Senha&hellip;","_links":{"self":[{"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=\/wp\/v2\/pages\/1090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1090"}],"version-history":[{"count":28,"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=\/wp\/v2\/pages\/1090\/revisions"}],"predecessor-version":[{"id":3645,"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=\/wp\/v2\/pages\/1090\/revisions\/3645"}],"wp:attachment":[{"href":"https:\/\/jecoz12.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}