/* Tela de entrada, cadastro e criação da empresa */
body.pre-auth > *:not(#auth) { display: none !important; }
#auth[hidden] { display: none; }
#auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); color: var(--ink); }
.au-card { width: min(100%, 400px); display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 20px; }
.au-brand { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.au-sub { margin: 0; color: var(--muted); }
.au-form { display: flex; flex-direction: column; gap: 12px; }
.au-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.au-form input { font: inherit; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); min-height: 44px; }
.au-form input:focus-visible, .au-btn:focus-visible, .au-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.au-btn { font: inherit; font-weight: 600; min-height: 46px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.au-btn[disabled] { opacity: .6; cursor: wait; }
.au-link { font: inherit; background: none; border: 0; padding: 8px 0; color: var(--accent); text-decoration: underline; cursor: pointer; text-align: left; }
.au-msg { margin: 0; padding: 10px 12px; border-radius: 8px; background: #FBE4E2; color: #7A1C14; }
.au-msg.ok { background: var(--good-soft); color: var(--good); }
.au-hint { margin: 0; font-size: 13px; color: var(--muted); }
body.real .sample { display: block; }
body.real .sample.save-err { color: var(--bad); cursor: pointer; }
body.real .simbar, body.real #simNote, body.real .drawer-foot .lbl, body.real #asUser, body.real .drawer-foot > p.muted,
body.real #tab-respostas, body.real #tab-auto, body.real #tab-chatbot,
body.real .bottombar [data-tab="respostas"] { display: none !important; }
.logout-btn { margin-top: 8px; }
.au-pw { position: relative; display: block; }
.au-pw input { width: 100%; box-sizing: border-box; padding-right: 48px; }
.au-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.au-eye:hover, .au-eye[aria-pressed="true"] { color: var(--accent); }
.au-eye:focus-visible { outline: 3px solid var(--accent); outline-offset: -2px; }

/* Painel master */
#auth.au-wide { place-items: start center; padding: 16px; }
.mp { width: min(100%, 1000px); display: flex; flex-direction: column; gap: 14px; }
.mp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-tabs { display: flex; gap: 4px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; align-self: flex-start; }
.mp-tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 8px; font-weight: 600; color: var(--muted); min-height: 40px; }
.mp-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.mp-bar { display: flex; flex-direction: column; gap: 10px; }
.mp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mp-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.mp-main { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.mp-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 16px; margin: 0; }
.mp-meta dt { font-size: 12px; color: var(--muted); }
.mp-meta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.mp-edit { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.mp-grid label, .mp-feat { display: flex; flex-direction: column; gap: 4px; font-weight: 500; min-width: 0; }
.mp-wide { grid-column: 1 / -1; }
.mp-edit input:not([type="checkbox"]), .mp-edit select, .mp-edit textarea { font: inherit; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); min-height: 40px; width: 100%; min-width: 0; }
.mp-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-feats { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mp-feat { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; align-items: center; gap: 10px; }
.mp-feat .muted { display: block; font-weight: 400; font-size: 12px; }
.mp-check { display: flex; flex-direction: row !important; gap: 8px; align-items: flex-start; }
.mp-hint { margin: 0; min-height: 1em; }
@media (max-width: 640px) { .mp-feat { grid-template-columns: 1fr; } }
.mp .pill.good { color: var(--good); border-color: var(--good); background: var(--good-soft); }
.mp .pill.warn { background: #FFF1D6; color: #5C3B00; border-color: #E3B35A; }
.mp .pill.bad { background: #FBE4E2; color: #7A1C14; border-color: #B3261E; }
.mp .pill.info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* Aviso de acesso (teste, atraso, modo suporte) */
.a-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); }
.a-banner[hidden] { display: none; }
.a-banner.warn { background: #FFF1D6; color: #5C3B00; }
.a-banner.support { background: #EDE7FA; color: #3F2A86; }
.a-banner button { margin-left: auto; }

/* Recursos desligados no plano */
body.nf-funil #tab-funil, body.nf-automacoes #tab-auto, body.nf-chatbot #tab-chatbot, body.nf-chat_interno #tab-interno,
body.nf-chat_interno .bottombar [data-tab="interno"], body.nf-mensagens_rapidas #tab-respostas,
body.nf-importacao [data-ct="imp-open"], body.nf-importacao [data-ct="flds-open"] { display: none !important; }
.mp-life { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.mp-cred { background: var(--au-field, #f4f6f8); border: 1px solid var(--au-line, #d5dbe1); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-all; font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; margin: 10px 0; user-select: all; }

.pill.pend { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mfail { color: var(--bad); font-weight: 600; }
.meta .link { font-size: inherit; }
body.support-ro .composer { opacity: .6; }
