/* AVELTRIM RC1 — Redes, OCPP e Telegram. Escopo local; paleta aprovada na Gestão. */
html body [data-view="platform"]{--rc-green:#176b47;--rc-dark:#14372c;--rc-line:#d5e3da;--rc-muted:#60786b;max-width:none!important;width:100%;min-width:0}
html body [data-view="platform"] .av-pf-tablebox td{padding:14px 12px;line-height:1.5;vertical-align:middle}
html body [data-view="platform"] .av-pf-table td:first-child{max-width:310px;overflow-wrap:anywhere}
html body [data-view="platform"] .av-pf-tablebox td small{font-size:12px;color:#60786b;line-height:1.5}
html body [data-view="platform"] .av-pf-tablebox td .status{vertical-align:middle}
html body [data-view="platform"] .av-pf-actions{min-width:132px;width:140px}
html body [data-view="platform"] .av-pf-actions .action{margin:0 0 6px;min-height:36px;font-size:12px;font-weight:600;border-radius:8px}
html body [data-view="platform"] .av-pf-actions .action:last-child{margin-bottom:0}
html body [data-view="platform"] button[data-pf-login]{background:#176b47;color:#fff;border-color:#176b47}
html body [data-view="platform"] button[data-pf-login]:hover{background:#12583c;color:#fff}
html body [data-view="platform"] .av-pf-actions .av-rc3-menu-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#176b47;padding:8px 10px}
html body [data-view="platform"] .av-rc3-menu-trigger svg{width:14px;height:14px;flex:none}
html body [data-view="platform"] .av-rc3-menu-trigger:has(+ :popover-open) svg{transform:rotate(180deg)}
html body [data-view="platform"] .av-rc3-menu{position:fixed;inset:auto;margin:0;width:min(248px,calc(100vw - 16px));max-height:min(430px,calc(100dvh - 16px));overflow:auto;box-sizing:border-box;padding:7px;border:1px solid #d5e3da;border-radius:12px;background:#fff;box-shadow:0 12px 36px #14372c24;z-index:1000}
html body [data-view="platform"] .av-rc3-menu:not(:popover-open){display:none}
html body [data-view="platform"] .av-rc3-menu:popover-open{display:grid;gap:2px}
html body [data-view="platform"] .av-rc3-menu-title{padding:8px 10px 10px;color:#60786b;font-size:12px;text-align:left;overflow-wrap:anywhere;border-bottom:1px solid #e4ece7;margin-bottom:3px}
html body [data-view="platform"] .av-rc3-menu .action{margin:0;min-height:35px;display:flex;align-items:center;justify-content:flex-start;text-align:left;border:0;border-radius:7px;background:#fff;color:#173329;padding:8px 10px;font-weight:550}
html body [data-view="platform"] .av-rc3-menu .action:hover:not(:disabled){background:#edf5ef;color:#176b47}
html body [data-view="platform"] .av-rc3-menu .action.danger{color:#a43c34;border-top:1px solid #e7ece9;background:#fff}
html body [data-view="platform"] .av-rc3-menu .action.danger:hover{background:#fff2ef;color:#a43c34}
html body [data-view="platform"] .av-rc3-inv{display:flex;align-items:center;flex-direction:column;gap:7px;white-space:nowrap}
html body [data-view="platform"] :is([data-pf-paid],[data-pf-nfse],[data-pf-close]){color:#176b47;border-color:#c7dfd0;background:#f5faf7;min-height:34px;font-size:12px;font-weight:600}
html body [data-view="platform"] :is([data-pf-cancel],[data-pf-unpay]){color:#a43c34;border-color:#ead4d1;font-weight:550}
html body [data-view="platform"] .av-pf-kpis>div{min-height:112px;justify-content:center;box-shadow:0 2px 5px #163b2c06}
html body [data-view="platform"] .av-pf-section{box-shadow:0 2px 6px #163b2c06}
/* Modal opt-in sobre AvForm real: não altera outros formulários. */
html body dialog.av-form-dialog.av-rc3-dialog{position:fixed!important;inset:0!important;margin:auto!important;width:min(550px,calc(100vw - 24px))!important;max-width:none!important;max-height:calc(100dvh - 28px)!important;border:1px solid #d5e3da!important;border-radius:15px!important;padding:0!important;background:#fff!important;color:#173329!important;overflow:hidden!important;box-shadow:0 20px 55px #152c2533!important;box-sizing:border-box}
html body dialog.av-rc3-dialog.av-catalog-dialog{width:min(760px,calc(100vw - 24px))!important}
html body dialog.av-rc3-dialog:has(>.av-select-menu){overflow:visible!important}
html body dialog.av-rc3-dialog::backdrop,html body dialog.av-rc3-payments::backdrop,html body dialog.av-rc3-gateways::backdrop{background:#142d246e!important;backdrop-filter:none!important}
html body dialog.av-rc3-dialog form.av-form{display:flex!important;flex-direction:column!important;gap:0!important;position:relative;max-height:calc(100dvh - 30px)!important;min-height:0!important;padding:0!important;margin:0!important;overflow:auto!important;overscroll-behavior:contain;box-sizing:border-box}
html body dialog.av-rc3-dialog #avFormTitle{padding:21px 66px 7px 22px!important;margin:0!important;font-size:20px!important;font-weight:650!important;line-height:1.35!important;color:#173329!important;letter-spacing:-.02em;flex:none;border:0!important}
html body dialog.av-rc3-dialog .av-form-desc{padding:0 22px 18px!important;margin:0!important;color:#60786b!important;font-size:13px!important;line-height:1.55!important;font-weight:400!important;flex:none;overflow-wrap:anywhere;border-bottom:1px solid #e1eae4}
html body dialog.av-rc3-dialog .av-rc3-x,html body dialog.av-rc3-gateways .av-rc3-gw-close{position:absolute;top:17px;right:19px;width:36px!important;height:36px!important;min-height:36px!important;padding:0!important;border:1px solid #d5e3da!important;border-radius:8px!important;display:grid!important;place-items:center!important;background:#fff!important;color:#173329!important;box-shadow:none!important;z-index:3}
html body dialog.av-rc3-dialog .av-rc3-x svg,html body dialog.av-rc3-gateways .av-rc3-gw-close svg{width:18px;height:18px;display:block}
html body dialog.av-rc3-dialog .av-form-fields{padding:18px 22px!important;display:grid!important;gap:13px!important;min-height:0;min-width:0;overflow:auto!important;flex:1 1 auto!important;box-sizing:border-box}
html body dialog.av-rc3-dialog .av-form-fields:empty{padding:0!important;display:none!important}
html body dialog.av-rc3-dialog.av-catalog-dialog .av-form-fields{grid-template-columns:minmax(0,1fr)!important}
html body dialog.av-rc3-dialog .av-form-fields label{font-size:13px!important;line-height:1.4;font-weight:550!important;color:#173329!important;gap:6px;min-width:0}
html body dialog.av-rc3-dialog :is(input:not([type=checkbox],[type=radio],[type=hidden]),select,textarea){box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:42px!important;padding:10px 12px;border:1px solid #cbdcd1!important;border-radius:8px!important;color:#173329!important;font-size:14px!important;font-weight:400!important;box-shadow:none!important;background-color:#fff!important}
html body dialog.av-rc3-dialog :is(input,select,textarea):focus{border-color:#65aa83!important;box-shadow:0 0 0 2px #176b4725!important;outline:0!important}
html body dialog.av-rc3-dialog .av-form-help{display:block;margin:5px 0 0!important;font-size:12px!important;color:#60786b!important;font-weight:400!important;line-height:1.5}
html body dialog.av-rc3-dialog .av-form-check{display:flex!important;align-items:flex-start;gap:10px!important;border:1px solid #d5e3da!important;border-radius:8px;padding:12px!important;background:#f7faf8}
html body dialog.av-rc3-dialog .av-form-check:has(input:checked){background:#eaf5ee;border-color:#b9d9c6!important}
html body dialog.av-rc3-dialog .av-form-check input{width:17px!important;height:17px!important;margin:1px 0 0!important;flex:none;accent-color:#176b47}
html body dialog.av-rc3-dialog .av-form-actions,html body dialog.av-rc3-payments .av-form-actions{position:sticky;bottom:0;display:flex!important;justify-content:flex-end!important;flex-direction:row!important;gap:9px!important;align-items:center!important;flex:none;padding:14px 22px!important;margin:0!important;border-top:1px solid #e1eae4;background:#fff!important;z-index:2}
html body dialog.av-rc3-dialog .av-form-actions button,html body dialog.av-rc3-payments .av-form-actions button{min-height:40px!important;border-radius:8px!important;padding:9px 15px!important;min-width:88px;max-width:100%;width:auto;font-size:13px!important;font-weight:650!important;box-shadow:none!important;text-transform:none!important;line-height:1.4!important}
html body dialog.av-rc3-dialog .av-form-actions .primary,html body dialog.av-rc3-payments .av-form-actions .primary{background:#176b47!important;border:1px solid #176b47!important;color:#fff!important}
html body dialog.av-rc3-dialog .av-form-actions .secondary,html body dialog.av-rc3-payments .av-form-actions .secondary{background:#fff!important;border:1px solid #d5e3da!important;color:#173329!important}
html body dialog.av-rc3-dialog .av-form-actions .av-danger{background:#a43c34!important;border:1px solid #a43c34!important;color:#fff!important}
html body dialog.av-rc3-dialog .av-form-actions .primary:hover{background:#12583c!important}
html body dialog.av-rc3-dialog .av-form-error:not(:empty),html body dialog.av-rc3-payments .av-form-error:not(:empty){padding:10px 22px;margin:0!important;font-size:12px!important;flex:none;color:#a43c34!important}
html body dialog.av-rc3-dialog .av-form-section{border:1px solid #d5e3da;border-radius:9px;background:#fff;margin:0;min-width:0;overflow:visible}
html body dialog.av-rc3-dialog .av-form-section>summary{font-size:13px;font-weight:650;padding:13px 15px;color:#176b47;background:#f5f9f6;border-radius:8px;cursor:pointer}
html body dialog.av-rc3-dialog .av-form-section[open]>summary{border-bottom:1px solid #d5e3da;border-radius:8px 8px 0 0}
html body dialog.av-rc3-dialog .av-form-section-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:15px;min-width:0}
html body dialog.av-rc3-dialog .av-form-section-grid .av-catalog-wide{grid-column:1/-1}
html body dialog.av-rc3-dialog .av-form-copy{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
html body dialog.av-rc3-dialog .av-form-copy input{font:400 13px/1.45 ui-monospace,Consolas,monospace!important;background:#f6f9f7!important}
html body dialog.av-rc3-dialog .av-form-copy .action{border:1px solid #cbdcd1!important;border-radius:8px!important;background:#fff!important;color:#176b47!important;min-height:42px;font-size:12px!important;font-weight:600!important;padding:8px 12px!important}
html body dialog.av-rc3-dialog .av-pf-log{margin:16px 22px;padding:14px;background:#f3f7f4;border-radius:8px;max-height:45vh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}
html body dialog.av-rc3-dialog :is(.av-pf-nfse-marker, .av-pf-invoice-preview){margin-inline:22px}
/* Pagamentos da rede: reutiliza AvPaymentForm e suas opções reais. */
html body dialog.av-rc3-payments{width:min(900px,calc(100vw - 24px))!important;max-height:calc(100dvh - 28px)!important;padding:0!important;border:1px solid #d5e3da!important;border-radius:15px!important;overflow:auto!important;background:white!important}
html body dialog.av-rc3-payments form{display:flex!important;flex-direction:column;gap:0!important;max-height:calc(100dvh - 30px);padding:0!important;margin:0!important;min-height:0}
html body dialog.av-rc3-payments .av-dialog-head{padding:20px 22px!important;flex:none;display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #d5e3da}
html body dialog.av-rc3-payments .av-dialog-head h2{font-size:20px!important;font-weight:650!important;margin:0 0 5px!important}
html body dialog.av-rc3-payments .av-dialog-head p{font-size:13px!important;margin:0!important;color:#60786b!important;line-height:1.5}
html body dialog.av-rc3-payments .avp-grid{overflow:auto;min-height:0;padding:18px 22px;gap:12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
html body dialog.av-rc3-payments .avp-card{padding:15px;border-radius:10px;border:1px solid #d5e3da;min-width:0}
html body dialog.av-rc3-payments .avp-card h3{color:#176b47;font-size:15px;font-weight:650}
html body dialog.av-rc3-payments .avp-card p,html body dialog.av-rc3-payments .avp-card small{font-size:12px!important;color:#60786b;line-height:1.5;overflow-wrap:anywhere}
html body dialog.av-rc3-payments .avp-opt{padding:11px;border-radius:8px;border:1px solid #d5e3da;gap:9px;font-size:13px;min-width:0}
html body dialog.av-rc3-payments .avp-opt:has(input:checked){background:#eaf5ee;border-color:#8cc3a4}
html body dialog.av-rc3-payments .avp-card input:not([type=radio],[type=checkbox]){min-height:42px;border:1px solid #cbdcd1;border-radius:8px;width:100%;box-sizing:border-box;font-size:13px;font-weight:400}
html body dialog.av-rc3-payments .avp-warn{margin:0 22px 12px;padding:10px 12px;font-size:12px;flex:none}
html body dialog.av-rc3-payments .av-dialog-head button{min-height:36px;border-radius:8px;align-self:flex-start;font-size:12px;color:#173329;background:#fff;border:1px solid #d5e3da}
/* Remote gateways uses the existing gateway module, not a duplicate form. */
html body dialog.av-rc3-gateways{width:min(1120px,calc(100vw - 24px))!important;border:1px solid #d5e3da!important;border-radius:15px!important;padding:0!important;background:#f3f6f4!important;max-height:calc(100dvh - 28px)!important;overflow:auto!important;box-sizing:border-box}
html body dialog.av-rc3-gateways>div:first-child{position:sticky;top:0;z-index:2;background:#fff;padding:20px 65px 18px 22px;margin:0!important;border-bottom:1px solid #d5e3da}
html body dialog.av-rc3-gateways>div:first-child h2{font-size:20px;font-weight:650;color:#173329}
html body dialog.av-rc3-gateways>div:first-child p{font-size:13px;line-height:1.5;color:#60786b}
html body dialog.av-rc3-gateways>[data-body]{padding:18px;min-width:0;box-sizing:border-box}
/* OCPP: preserva estados e disponibilidade da senha. */
html body #ocppSecurityCard .av-rc3-ocpp-head{display:flex!important;justify-content:space-between;align-items:center;gap:10px;min-height:0;padding:12px 18px!important}
html body #ocppSecurityCard .av-rc3-ocpp-head span{font-size:12px!important;letter-spacing:0!important;color:#176b47;font-weight:650}
html body #ocppSecurityCard #ocppSecReload{min-height:34px!important;padding:7px 12px!important;border-radius:8px!important;font-size:12px!important;font-weight:600!important;color:#176b47!important;border:1px solid #d5e3da;background:#fff}
html body #ocppSecurityCard .av-rc3-ocpp-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:180px}
html body #ocppSecurityCard .av-rc3-ocpp-actions .action{margin:0!important;border:1px solid #cbdcd1!important;background:#fff!important;color:#176b47!important;border-radius:8px!important;min-height:34px!important;padding:7px 10px!important;font-size:12px!important;font-weight:550!important}
html body #ocppSecurityCard .av-rc3-ocpp-actions [data-ocpp-remove]{color:#a43c34!important;border-color:#ead4d1!important}
html body #ocppSecurityCard .avkp-enforce{padding:8px 10px;border:1px solid #d5e3da;border-radius:8px;background:#f8faf9;gap:8px!important}
html body #ocppSecurityCard .avkp-enforce:has(input:checked){background:#eaf5ee;border-color:#c4decf}
html body #ocppSecurityCard .avkp-enforce input{accent-color:#176b47;width:16px!important;height:16px!important;min-height:0!important}
html body #ocppSecurityCard .table{overflow:auto;max-width:100%}
html body #ocppSecurityCard table{min-width:790px}
/* Telegram: same metrics/card structure as email and push, including team and bot. */
html body [data-view="telegram"]{--tg-green:#176b47;--tg-dark:#14372c;--tg-ink:#173329;--tg-muted:#60786b;--tg-line:#d5e3da;--tg-soft:#f3f7f4;min-width:0}
html body [data-view="telegram"] :is(#avTgBody,#avCnTg,.avt-heading){max-width:none!important;width:100%;min-width:0}
html body [data-view="telegram"] #avCnTg .avc-card{border:1px solid #d5e3da;border-radius:12px;background:white;padding:18px;min-width:0;margin-top:16px}
html body [data-view="telegram"] #avCnTg .avt-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
html body [data-view="telegram"] #avCnTg .avt-notice-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}
html body [data-view="telegram"] #avCnTg .avt-stat{display:grid;gap:9px;padding:16px;border:1px solid #d5e3da;border-radius:10px;background:#fff;min-width:0}
html body [data-view="telegram"] #avCnTg .avt-stat:first-child{background:#14372c;color:#fff;border-color:#14372c}
html body [data-view="telegram"] #avCnTg .avt-stat:first-child :is(strong,span){color:#fff}
html body [data-view="telegram"] #avCnTg .avt-stat strong{font-size:25px;font-weight:650;line-height:1.2}
html body [data-view="telegram"] #avCnTg .avt-stat span{font-size:12px;line-height:1.4}
html body [data-view="telegram"] #avCnTg .avt-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}
html body [data-view="telegram"] #avCnTg .avt-group{padding:13px;border:1px solid #d5e3da;border-radius:10px;background:#fff;min-width:0}
html body [data-view="telegram"] #avCnTg .avt-group h4{font-size:13px;color:#176b47;font-weight:650;margin:0 0 10px}
html body [data-view="telegram"] :is(#avCnTg .avt-group,#avTgBody .avt-checks) label{display:flex;align-items:center;gap:8px;line-height:1.4;font-size:13px;padding:8px;border:1px solid transparent;border-radius:7px;min-width:0;overflow-wrap:anywhere}
html body [data-view="telegram"] :is(#avCnTg .avt-group,#avTgBody .avt-checks) label:has(input:checked){background:#eaf5ee;border-color:#d1e6d9}
html body [data-view="telegram"] :is(#avCnTg,#avTgBody) input:is([type=checkbox],[type=radio]){accent-color:#176b47;min-height:0!important;width:16px!important;height:16px!important;margin:0!important;flex:none}
html body [data-view="telegram"] #avCnTg .avc-btns{display:flex;gap:8px;flex-wrap:wrap;align-items:center;padding-top:14px;border-top:1px solid #d5e3da}
html body [data-view="telegram"] #avCnTg .avt-count{font-size:12px;color:#60786b;margin-left:auto}
html body [data-view="telegram"] #avCnTg .avt-note{font-size:12px;line-height:1.5;color:#60786b;margin:12px 0 0}
html body [data-view="telegram"] #avCnTg button.primary{background:#176b47!important;color:#fff!important;border-color:#176b47!important;font-size:13px!important;border-radius:8px!important;min-height:40px}
html body [data-view="telegram"] #avCnTg button.action{background:#fff!important;color:#173329!important;border:1px solid #d5e3da!important;border-radius:8px!important;font-size:13px!important;min-height:40px}
@media(max-width:900px){html body [data-view="telegram"] #avCnTg .avt-groups{grid-template-columns:repeat(2,minmax(0,1fr))}html body dialog.av-rc3-payments .avp-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){html body [data-view="telegram"] #avCnTg :is(.avt-groups,.avt-notice-summary){grid-template-columns:minmax(0,1fr)}html body dialog.av-rc3-dialog .av-form-section-grid{grid-template-columns:minmax(0,1fr);padding:12px}html body dialog.av-rc3-dialog .av-form-fields{padding:14px!important}html body dialog.av-rc3-dialog .av-form-actions{padding:12px 14px!important;flex-wrap:wrap}html body dialog.av-rc3-dialog #avFormTitle{padding-left:14px!important}html body dialog.av-rc3-dialog .av-form-desc{padding-left:14px!important;padding-right:14px!important}html body dialog.av-rc3-dialog .av-form-copy{grid-template-columns:minmax(0,1fr) auto}html body [data-view="telegram"] #avCnTg .avt-count{margin:0;width:100%}}
/* Match the established main-action hierarchy, overriding the old generic action rule. */
html body [data-view="platform"] .av-pf-actions button[data-pf-login]{background:#176b47!important;color:#fff!important;border-color:#176b47!important}
html body [data-view="platform"] .av-pf-actions button[data-pf-login]:hover{background:#12583c!important}
html body [data-view="platform"] .av-rc3-inv button[data-pf-paid],html body [data-view="platform"] .av-pf-actions button[data-pf-paid]{background:#f1f8f3!important;color:#176b47!important;border:1px solid #c3ddcc!important}
html body [data-view="platform"] .av-pf-actions button:is([data-pf-cancel],[data-pf-unpay]){color:#a43c34!important;border-color:#ead4d1!important}
html body [data-view="telegram"] #avCnTg .avt-group label{margin:4px 0; font-weight:500}
@media(max-width:600px){html body [data-view="platform"] .av-pf-section{padding:12px}html body [data-view="platform"] .av-pf-head{align-items:stretch}html body [data-view="platform"] .av-pf-tools{width:100%}html body [data-view="platform"] .av-pf-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
