/* b3-audio-e-composicao.css — pedaço 3/8 do antigo painel-body.css. A ORDEM dos links
   no index.html é a cascata: não reordenar, não trocar de posição. */

        .audio-placeholder-wave.is-digifood-thinking .audio-placeholder-bar:nth-child(3n + 1),
        .audio-transcription-wave .audio-placeholder-bar:nth-child(3n + 1) {
            animation-delay: -0.48s;
        }

        .audio-transcription-status {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 12px;
            background: rgba(37, 211, 102, 0.08);
            border: 1px solid rgba(37, 211, 102, 0.12);
        }

        .audio-transcription-status-text {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            color: var(--accent);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .audio-transcription-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--accent);
            box-shadow: 0 0 0 rgba(37, 211, 102, 0.45);
            animation: digifoodPulseDot 1.2s ease-out infinite;
            flex: 0 0 auto;
        }

        .audio-transcription-wave {
            display: grid;
            grid-template-columns: repeat(8, 3px);
            align-items: end;
            gap: 3px;
            height: 18px;
            flex: 0 0 auto;
        }

        .bubble.sent .audio-placeholder-bar {
            background: rgba(255,255,255,0.24);
        }

        .bubble.sent .audio-transcription-status {
            background: rgba(255, 255, 255, 0.14);
            border-color: rgba(255, 255, 255, 0.18);
        }

        .bubble.sent .audio-transcription-status-text {
            color: #fff;
        }

        .bubble.sent .audio-transcription-dot {
            background: #fff;
            box-shadow: 0 0 0 rgba(255, 255, 255, 0.45);
        }

        :root.light-theme .bubble.received .audio-placeholder-bar {
            background: rgba(17,27,33,0.14);
        }

        :root.light-theme .bubble.received .audio-placeholder-wave.is-digifood-thinking .audio-placeholder-bar,
        :root.light-theme .bubble.received .audio-transcription-wave .audio-placeholder-bar {
            background: linear-gradient(180deg, rgba(0,168,132,0.95), rgba(0,168,132,0.28));
        }

        :root.light-theme .bubble.sent .audio-placeholder-bar {
            background: rgba(15,81,50,0.18);
        }

        @keyframes digifoodAudioThinking {
            0%, 100% { transform: scaleY(0.55); opacity: 0.58; }
            45% { transform: scaleY(1.18); opacity: 1; }
        }


        .input-area {
            background: var(--bg-sidebar) !important; /* Matches sidebar/panel theme */
            padding: 10px 16px !important;
            display: flex !important;
            align-items: center;
            gap: 12px;
            position: relative !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            z-index: 12;
            flex-shrink: 0;
            min-width: 0;
            width: 100% !important;
            box-sizing: border-box !important;
            pointer-events: auto !important;
            border-top: 1px solid var(--border) !important;
        }

        .input-controls {
            display: flex;
            width: 100% !important;
            align-items: center;
            gap: 12px;
            margin: 0 !important;
            background: transparent !important;
            border-radius: 0 !important;
            padding: 0 !important;
            box-shadow: none !important;
            border: none !important;
            pointer-events: auto;
        }

        /* Hide input bar completely when visibility is hidden inline */
        #input-bar[style*="hidden" i] {
            display: none !important;
        }

        @keyframes digifoodAudioThinking {
            0%, 100% { transform: scaleY(0.55); opacity: 0.58; }
            45% { transform: scaleY(1.18); opacity: 1; }
        }

        @keyframes digifoodPulseDot {
            0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.42); }
            80%, 100% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
        }

        .audio-load-label {
            font-size: 12px;
            font-weight: 600;
        }

        .audio-load-hint {
            font-size: 11px;
            opacity: 0.72;
        }

        .bubble.interactive-bubble {
            max-width: min(360px, 78%);
            padding: 10px;
            border-radius: 16px;
        }

        .interactive-layout {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .interactive-thumb {
            flex: 0 0 88px;
            width: 88px;
        }

        .interactive-thumb img {
            width: 88px;
            height: 120px;
            object-fit: cover;
            border-radius: 12px;
            background: rgba(255,255,255,0.05);
            box-shadow: 0 8px 20px rgba(0,0,0,0.22);
        }

        .interactive-body {
            flex: 1;
            min-width: 0;
        }

        .interactive-body .message-content {
            font-size: 13px;
            line-height: 1.45;
        }

        /* Date Divider */
        .day-group {
            display: flex;
            flex-direction: column;
            width: 100%;
            position: relative;
        }

        .chat-date-divider {
            display: flex;
            justify-content: center;
            margin: 15px 0;
            position: sticky;
            top: 10px;
            z-index: 10;
            width: 100%;
            clear: both;
            pointer-events: none;
        }

        .chat-date-divider span {
            pointer-events: auto;
            background: #ffffff !important;
            color: #54656f !important;
            padding: 6px 14px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            box-shadow: 0 1px 2px rgba(0,0,0,0.2);
            border: 1px solid #d1d7db;
        }

        :root.dark-theme .chat-date-divider span {
            background: #182229 !important;
            color: #8696a0 !important;
            border: none;
            box-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .chat-top-banner {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            margin: 8px 0 18px;
            width: 100%;
        }

        .chat-top-banner-date {
            background: rgba(17, 27, 33, 0.92);
            color: #d9e1e5;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 600;
            box-shadow: 0 1px 2px rgba(0,0,0,0.25);
        }

        .chat-top-banner-encryption {
            max-width: min(100%, 560px);
            background: #182229;
            color: #ffd279;
            padding: 10px 16px;
            border-radius: 10px;
            font-size: 12px;
            line-height: 1.5;
            text-align: center;
            box-shadow: 0 1px 2px rgba(0,0,0,0.18);
        }

        .chat-top-banner-encryption i {
            margin-right: 6px;
        }

        :root.light-theme .chat-top-banner-date {
            background: rgba(255,255,255,0.96);
            color: #54656f;
            border: 1px solid #d1d7db;
        }

        :root.light-theme .chat-top-banner-encryption {
            background: #fff3c4;
            color: #5c4700;
            border: 1px solid rgba(92, 71, 0, 0.12);
        }

        /* HORA + CONFIRMACAO, do jeito do WhatsApp: ancorada no canto de baixo da
           bolha, com um espaçador invisível (`.msg-espaco`) fechando o texto para
           reservar o lugar dela. Assim a hora entra na sobra da última linha quando
           cabe e desce sozinha quando não cabe, sem nunca ficar por baixo do texto. */
        .msg-meta {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            height: 15px;
            font-size: 11px;
            line-height: 15px;
            white-space: nowrap;
            color: rgba(233, 237, 239, 0.6);
            user-select: none;
        }

        .msg-meta.no-canto {
            position: absolute;
            right: 9px;
            bottom: 5px;
        }

        .msg-espaco {
            display: inline-block;
            height: 1px;
        }

        :root.light-theme .msg-meta {
            color: rgba(17, 27, 33, 0.5);
        }

        .msg-ack {
            display: inline-flex;
            align-items: center;
        }

        .msg-ack i {
            margin-right: 0 !important;
        }

        /* Mídia, áudio ou anexo sem legenda: não há texto para a hora acompanhar,
           então ela vira uma linha própria alinhada à direita. */
        .msg-meta-linha {
            display: flex;
            justify-content: flex-end;
            margin-top: 2px;
        }

        .msg-meta-linha .msg-meta {
            margin: 0;
        }

        /* Foto/vídeo sem legenda: a hora vai POR CIMA da mídia, no canto, com o véu
           escuro do WhatsApp — senão ela cai num rodapé branco que a foto não tem. */
        .msg-meta-sobre-midia {
            position: absolute;
            right: 10px;
            bottom: 7px;
            padding: 2px 7px;
            border-radius: 999px;
            background: rgba(11, 20, 26, 0.45);
            backdrop-filter: blur(2px);
        }

        .msg-meta-sobre-midia .msg-meta,
        :root.light-theme .msg-meta-sobre-midia .msg-meta {
            margin: 0;
            color: #ffffff;
        }

        /* Compatibilidade: `.time` ainda existe em bolha antiga já renderizada. */
        .time {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.6);
            float: right;
            margin-top: 5px;
            margin-left: 10px;
            display: flex;
            align-items: center;
        }

        :root.light-theme .time {
            color: rgba(17, 27, 33, 0.6);
        }

        /* Cleaned up duplicate input area definition */

        .composer-icon-btn {
            width: 40px;
            height: 40px;
            border: none;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: transparent !important;
            color: #8696a0 !important; /* WhatsApp Web icon color */
            cursor: pointer;
            font-size: 20px;
            transition: background-color 0.2s, color 0.2s, transform 0.15s ease;
            flex-shrink: 0;
            box-shadow: none !important;
        }

        .composer-icon-btn:hover {
            background: rgba(255, 255, 255, 0.08) !important;
            color: #d1d7db !important;
        }

        :root.light-theme .composer-icon-btn {
            color: #54656f !important;
        }

        :root.light-theme .composer-icon-btn:hover {
            background: rgba(0, 0, 0, 0.05) !important;
            color: #111b21 !important;
        }

        .composer-icon-btn.primary {
            background: transparent !important;
            color: #8696a0 !important;
            box-shadow: none !important;
        }

        .composer-icon-btn.primary:hover {
            background: rgba(255, 255, 255, 0.08) !important;
            color: #d1d7db !important;
            transform: scale(1.08);
        }

        #btn-send-text {
            color: var(--accent) !important; /* Send text button is green in WhatsApp */
        }

        #btn-send-text:hover {
            color: #00c49b !important;
        }

        .input-box {
            flex: 1;
            background: var(--bg-main); /* Matches the main dark background */
            border-radius: 8px; /* Clean, modern rounded corner */
            padding: 9px 12px;
            min-height: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
            border: 1px solid var(--border);
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        .input-box:focus-within {
            background: var(--bg-main);
            border-color: var(--accent); /* Highlight border on focus */
        }

        :root.light-theme .input-box {
            background: #ffffff;
            border: 1px solid #ffffff;
        }

        .input-box textarea {
            border: none;
            background: transparent;
            outline: none;
            width: 100%;
            color: #d1d7db; /* WhatsApp text color */
            font-family: Segoe UI, -apple-system, sans-serif;
            font-size: 15px;
            font-weight: 400;
            line-height: 1.45;
            resize: none;
            min-height: 22px;
            max-height: 120px;
            overflow-y: auto;
            padding: 0;
        }

        :root.light-theme .input-box textarea {
            color: #111b21;
        }

        .input-box textarea::placeholder {
            color: #8696a0;
            font-weight: 400;
            letter-spacing: 0.015em;
        }

        .composer-attach-menu,
        .composer-picker {
            position: absolute;
            bottom: calc(100% + 10px);
            left: 0;
            z-index: 15;
            pointer-events: auto;
        }

        .composer-attach-menu {
            width: 220px;
            background: #111b21;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 18px;
            padding: 10px;
            box-shadow: 0 18px 48px rgba(0,0,0,0.45);
        }

        .composer-picker {
            width: min(560px, calc(100vw - 32px));
            background: #1f2c34;
            border: 1px solid rgba(255,255,255,0.07);
            border-radius: 18px;
            padding: 14px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.45);
        }

        .composer-hidden {
            display: none !important;
        }

        .composer-menu-item {
            width: 100%;
            border: none;
            background: transparent;
            color: #e9edef;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 10px;
            border-radius: 14px;
            cursor: pointer;
            text-align: left;
            font-size: 14px;
        }

        .composer-menu-item:hover {
            background: rgba(255,255,255,0.06);
        }

        .composer-menu-item i {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 14px;
        }

        .composer-picker-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 12px;
        }

        .composer-picker-tab {
            border: none;
            background: transparent;
            color: #aebac1;
            padding: 10px 12px;
            border-radius: 12px;
            cursor: pointer;
            font-weight: 600;
        }

        .composer-picker-tab.active {
            background: rgba(0, 168, 132, 0.14);
            color: #25d366;
        }

        .composer-picker-search {
            width: 100%;
            border: none;
            outline: none;
            background: rgba(255,255,255,0.08);
            color: #fff;
            border-radius: 999px;
            padding: 12px 14px;
            margin-bottom: 12px;
        }

        .composer-picker-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
            gap: 8px;
            max-height: 260px;
            overflow-y: auto;
        }

        .composer-emoji-btn {
            border: none;
            background: rgba(255,255,255,0.04);
            border-radius: 12px;
            min-height: 42px;
            font-size: 24px;
            cursor: pointer;
        }

        .composer-emoji-btn:hover {
            background: rgba(255,255,255,0.1);
        }

        .composer-media-card {
            border: none;
            background: rgba(255,255,255,0.04);
            border-radius: 12px;
            overflow: hidden;
            cursor: pointer;
            padding: 0;
            min-height: 74px;
            position: relative;
        }

        .composer-media-card img {
            display: block;
            width: 100%;
            height: 100%;
            min-height: 74px;
            object-fit: cover;
        }

        .composer-media-card::after {
            content: attr(data-label);
            position: absolute;
            left: 6px;
            right: 6px;
            bottom: 6px;
            padding: 4px 6px;
            border-radius: 8px;
            background: rgba(0,0,0,0.58);
            color: #fff;
            font-size: 11px;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .composer-picker-panel {
            display: none;
        }

        .composer-picker-panel.active {
            display: block;
        }

        .composer-picker-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .composer-action-card {
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.04);
            border-radius: 14px;
            padding: 16px;
            color: #e9edef;
            cursor: pointer;
            text-align: left;
        }

        .composer-action-card strong {
            display: block;
            margin-bottom: 4px;
            font-size: 14px;
        }

        .composer-action-card span {
            display: block;
            color: #8696a0;
            font-size: 12px;
            line-height: 1.4;
        }

        .composer-picker-hint {
            margin-top: 12px;
            color: #8696a0;
            font-size: 12px;
        }

        :root.light-theme .composer-attach-menu,
        :root.light-theme .composer-picker {
            background: #f7f8fa;
            border-color: rgba(17,27,33,0.08);
        }

        :root.light-theme .input-controls {
            background: transparent;
            box-shadow: none;
            backdrop-filter: none;
        }

        :root.light-theme .composer-menu-item,
        :root.light-theme .composer-action-card {
            color: #111b21;
        }

        :root.light-theme .composer-picker-search {
            background: rgba(17,27,33,0.06);
            color: #111b21;
        }

        :root.light-theme .composer-emoji-btn {
            background: rgba(17,27,33,0.04);
        }

        :root.light-theme .composer-emoji-btn:hover,
        :root.light-theme .composer-menu-item:hover,
        :root.light-theme .composer-action-card:hover,
        :root.light-theme .composer-icon-btn:hover {
            background: rgba(17,27,33,0.08);
        }

        @media (max-width: 768px) {
            .input-area {
                left: 0 !important;
                right: 0 !important;
                bottom: 0 !important;
                padding: 6px 10px calc(6px + env(safe-area-inset-bottom)) !important;
                flex-wrap: wrap;
            }

            .input-controls {
                padding: 0 !important;
                gap: 8px !important;
                border-radius: 0 !important;
                background: transparent !important;
                border: none !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                flex: 1;
                min-width: 0;
            }

            .composer-icon-btn {
                width: 36px;
                height: 36px;
                font-size: 18px;
                flex-shrink: 0;
            }

            .input-box {
                min-width: 0;
                min-height: 36px;
                padding: 6px 12px;
                background: var(--bg-main) !important;
                border: 1px solid var(--border) !important;
                box-shadow: none;
                border-radius: 8px;
            }

            :root.light-theme .input-box {
                background: #ffffff !important;
                border-color: #e9edef !important;
            }

            .composer-picker {
                width: min(92vw, 420px);
            }

            .messages-container {
                padding-bottom: 20px !important;
            }

            #assignment-overlay {
                width: 100% !important;
                flex-shrink: 0;
                border-radius: 0 !important;
                padding: 8px 12px !important;
                gap: 10px !important;
                font-size: 13px;
            }

            #assignment-overlay span {
                font-size: 13px !important;
                flex: 1;
                min-width: 0;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }

        /* Switch */
        .switch {
            position: relative;
            display: inline-block;
            width: 34px;
            height: 20px;
            margin-left: 5px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #383838;
            border: 1px solid rgba(255,255,255,0.08);
            box-sizing: border-box;
            transition: .4s;
            border-radius: 34px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 14px;
            width: 14px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background-color: var(--accent);
        }

        input:checked+.slider:before {
            transform: translateX(14px);
        }

        .audio-recording-container {
            display: none;
            align-items: center;
            justify-content: space-between;
            background: #1f2c34;
            flex: 1;
            padding: 4px 8px 4px 4px;
            border-radius: 999px;
            min-height: 38px;
            gap: 8px;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035);
        }

        .audio-pulsing {
            width: 10px;
            height: 10px;
            background-color: #ff7b8f;
            border-radius: 50%;
            animation: pulse-red 1.2s infinite;
            margin-right: 0;
        }

        .audio-timer {
            font-family: monospace;
            font-size: 13px;
            color: #f5f7f8;
            min-width: 38px;
            font-variant-numeric: tabular-nums;
        }

        .audio-actions {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        .audio-recording-left {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .audio-recording-status {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            flex: 1;
        }

        .audio-delete-btn,
        .audio-send-btn,
        .audio-lock-btn {
            width: 30px;
            height: 30px;
            border: none;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            font-size: 14px;
        }

        .audio-delete-btn {
            background: transparent;
            color: #f5f7f8;
            box-shadow: inset 0 0 0 2px #25d366;
        }

        .audio-send-btn {
            background: #25d366;
            color: #103529;
            box-shadow: 0 10px 24px rgba(37,211,102,0.28);
        }

        .audio-lock-btn {
            background: transparent;
            color: #c7d0d5;
            width: 22px;
            height: 22px;
            font-size: 12px;
        }

        .audio-waveform {
            flex: 1;
            min-width: 84px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 2px;
            height: 22px;
        }

        .audio-waveform span {
            width: 2px;
            height: 7px;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(217,227,232,0.95), rgba(163,177,185,0.9));
            transform-origin: center bottom;
            opacity: 0.48;
            transition: height 72ms linear, opacity 72ms linear, transform 72ms linear;
        }

        .audio-waveform span.audio-wave-active {
            opacity: 0.98;
            transform: scaleY(1.02);
        }

        @keyframes pulse-red {
            0% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
            }

            70% {
                transform: scale(1);
                box-shadow: 0 0 0 6px rgba(244, 67, 54, 0);
            }

            100% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
            }
        }

        /* Responsive Layout */
        .side-panel {
            position: absolute;
            top: 0;
            right: -500px;
            width: 450px;
            height: 100%;
            background: var(--bg-sidebar);
            border-left: 1px solid var(--border);
            transition: 0.3s;
            z-index: 100;
            display: flex;
            flex-direction: column;
        }

        .side-panel.open {
            right: 0;
        }

        .panel-header {
            background: var(--bg-header);
            padding: 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            border-bottom: 1px solid var(--border);
            font-weight: bold;
        }

        .panel-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .form-group {
            background: #252525;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 15px;
            border: 1px solid var(--border);
        }

        .form-group label {
            display: block;
            font-size: 12px;
            color: var(--accent);
            text-transform: uppercase;
            margin-bottom: 8px;
            font-weight: bold;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            background: transparent;
            border: none;
            border-bottom: 1px solid #333;
            color: white;
            padding: 5px 0;
            outline: none;
            font-size: 15px;
        }

        .btn {
            background: var(--accent);
            color: white;
            border: none;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            width: 100%;
            margin-top: 10px;
        }

        .btn-asaas {
            background: var(--asaas);
        }

        .btn-danger {
            background: #f44336;
        }

        /* Asaas Styling */
        .asaas-nav {
            display: flex;
            gap: 5px;
            margin-bottom: 20px;
        }

        .asaas-nav button {
            flex: 1;
            padding: 10px;
            font-size: 11px;
            border-radius: 5px;
            border: none;
            background: #383838;
            color: white;
            cursor: pointer;
        }

        .asaas-nav button.active {
            background: var(--asaas);
        }

        .asaas-item {
            background: var(--bg-header);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 8px;
            border-left: 4px solid var(--asaas);
            cursor: pointer;
        }

        .asaas-item:hover {
            background: #383838;
        }

        .badge {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: bold;
        }



        #qr-screen {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            z-index: 2000;
            display: none;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(4px);
        }

        #qr-screen .qr-modal {
            background: var(--bg-secondary);
            border-radius: 16px;
            padding: 30px 40px;
            text-align: center;
            position: relative;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5);
            border: 1px solid var(--border);
            max-width: 380px;
            animation: qrFadeIn 0.3s ease;
        }

        @keyframes qrFadeIn {
            from { opacity: 0; transform: scale(0.9); }
            to { opacity: 1; transform: scale(1); }
        }

        #qr-screen .qr-close {
            position: absolute;
            top: 12px;
            right: 16px;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 20px;
            cursor: pointer;
            transition: color 0.2s;
        }

        #qr-screen .qr-close:hover {
            color: var(--accent);
        }

        #qr-screen .qr-title {
            font-size: 18px;
            font-weight: bold;
            color: var(--text-main);
            margin-bottom: 5px;
        }

        #qr-screen .qr-subtitle {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 20px;
        }

        #qr-screen canvas {
            border-radius: 12px;
            background: white;
            padding: 10px;
            display: none;
            margin: 0 auto;
        }

        #qr-screen .qr-stage {
            width: 280px;
            min-height: 280px;
            border-radius: 16px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto;
            overflow: hidden;
        }

        #qr-screen .qr-loading {
            width: 100%;
            min-height: 280px;
            padding: 28px 22px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 14px;
        }

        #qr-screen .qr-loading[hidden] {
            display: none;
        }

        #qr-screen .qr-loader-ring {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            border: 3px solid rgba(37, 211, 102, 0.18);
            border-top-color: #25D366;
            animation: qrSpin 0.9s linear infinite;
        }

        #qr-screen .qr-loader-bar {
            width: 168px;
            height: 4px;
            border-radius: 999px;
            background: rgba(255,255,255,0.08);
            overflow: hidden;
            position: relative;
        }

        #qr-screen .qr-loader-bar::after {
            content: '';
            position: absolute;
            top: 0;
            left: -40%;
            width: 40%;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, rgba(37,211,102,0), rgba(37,211,102,0.95), rgba(37,211,102,0));
            animation: qrBarSlide 1.2s ease-in-out infinite;
        }

        #qr-screen .qr-loading-title {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-main);
        }

        #qr-screen .qr-loading-text {
            font-size: 12px;
            line-height: 1.55;
            color: var(--text-secondary);
            max-width: 220px;
        }

        #qr-screen .qr-status-note {
            margin-top: 12px;
            min-height: 18px;
            font-size: 11px;
            color: var(--text-secondary);
        }

        #qr-screen .qr-footer {
            margin-top: 15px;
            font-size: 11px;
            color: var(--text-secondary);
        }

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

        @keyframes qrBarSlide {
            0% { left: -40%; }
            100% { left: 100%; }
        }

        /* Modal Avançado Configurações */
        #settings-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .settings-container {
            width: 92%;
            max-width: 1080px;
            height: 86vh;
            max-height: 840px;
            background: var(--bg-main);
            border-radius: 20px;
            display: flex;
            overflow: hidden;
            border: 1px solid var(--border);
            box-shadow: 0 24px 72px -12px rgba(0, 0, 0, 0.8);
        }

        .settings-sidebar {
            width: 270px;
            background: var(--bg-sidebar);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            flex-shrink: 0;
        }

        .settings-sidebar-header {
            padding: 20px 22px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .settings-nav {
            list-style: none;
            padding: 12px 14px;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
            overflow-y: auto;
        }

        .settings-nav li {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            border-radius: 12px;
            font-size: 13.5px;
            font-weight: 500;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            border: 1px solid transparent;
            background: transparent;
            position: relative;
        }

        .settings-nav li:hover {
            background: var(--bg-surface-hover);
            color: var(--text-main);
            transform: translateX(3px);
        }

        .settings-nav li.active {
            background: var(--bg-surface);
            color: var(--accent);
            font-weight: 700;
            border-color: var(--accent-border);
            box-shadow: var(--shadow-sm);
        }

        .settings-nav li.active::after {
            content: '';
            position: absolute;
            right: 12px;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--accent);
            box-shadow: 0 0 8px var(--accent);
        }

        .settings-content-area {
            flex: 1;
            padding: 32px 38px;
            overflow-y: auto;
            background: var(--bg-main);
        }

        .settings-section-title {
            font-size: 22px;
            margin-bottom: 6px;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--text-primary);
        }

        .settings-section-desc {
            color: var(--text-secondary);
            font-size: 13.5px;
            margin-bottom: 24px;
            line-height: 1.5;
        }

        .settings-card {
            background: var(--bg-card);
            border-radius: 14px;
            padding: 20px 22px;
            margin-bottom: 18px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-xs);
        }

        .settings-card h4 {
            margin: 0 0 8px 0;
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .settings-card p {
            margin: 0 0 14px 0;
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.45;
        }

        .settings-input {
            width: 100%;
            background: var(--bg-input);
            border: 1px solid var(--border);
            color: var(--text-main);
            padding: 10px 14px;
            border-radius: 10px;
            box-sizing: border-box;
            font-family: inherit;
            font-size: 13.5px;
            transition: all 0.15s ease;
        }

        .settings-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-subtle);
        }

        .btn-green {
            background: var(--accent-strong, #00806a);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            font-size: 14px;
            transition: 0.2s;
        }

        .btn-green:hover {
            background: #006856;
        }

        .btn-red {
            background: #f44336;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            font-size: 14px;
            transition: 0.2s;
        }

        .btn-red:hover {
            background: #d32f2f;
        }

