/* Escola VIP — Painel de Atendimento
   Visual estilo Apple (claro, translúcido, cantos suaves) com o layout do WhatsApp Web.
   Cores da escola: azul-marinho e dourado. Tema claro, escuro ou automático (botão no menu lateral). */
:root {
  color-scheme: light;
  --fundo: #f5f5f7;
  --painel: rgba(255, 255, 255, 0.82);
  --solido: #ffffff;
  --barra: #f0f2f5;
  --linha: rgba(0, 0, 0, 0.08);
  --linha-forte: rgba(0, 0, 0, 0.14);
  --texto: #1d1d1f;
  --sutil: #6e6e73;
  --marinho: #0b1f3a;
  --ouro: #c9a227;
  --azul: #007aff;
  --verde: #00a884;
  --vermelho: #ff3b30;
  --laranja: #ff9500;
  --hover: rgba(0, 0, 0, 0.04);
  --selecionado: #e9edef;
  --chat-fundo: #efeae2;
  --chat-ponto: rgba(0, 0, 0, 0.035);
  --bolha-in: #ffffff;
  --bolha-out: #d9fdd3;
  --bolha-robo: #e7efff;
  --campo: #ffffff;
  --humano-cor: #c76a00;
  --aba-ativa: #ffffff;
  --pend-fundo: #fff8e1;
  --pend-texto: #6b5200;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --sombra-bolha: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
}
/* Modo escuro: automático (segue o computador) ou escolhido no botão do menu lateral */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fundo: #0b141a;
    --painel: rgba(17, 27, 33, 0.86);
    --solido: #111b21;
    --barra: #202c33;
    --linha: rgba(255, 255, 255, 0.08);
    --linha-forte: rgba(255, 255, 255, 0.16);
    --texto: #e9edef;
    --sutil: #8696a0;
    --marinho: #e9edef;
    --ouro: #e0b84a;
    --azul: #0a84ff;
    --hover: rgba(255, 255, 255, 0.05);
    --selecionado: #2a3942;
    --chat-fundo: #0b141a;
    --chat-ponto: rgba(255, 255, 255, 0.025);
    --bolha-in: #202c33;
    --bolha-out: #005c4b;
    --bolha-robo: #1f3554;
    --campo: #2a3942;
    --sombra: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --humano-cor: #ff9500;
    --aba-ativa: #3b4a54;
    --pend-fundo: #2b2614;
    --pend-texto: #f0d98a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fundo: #0b141a;
  --painel: rgba(17, 27, 33, 0.86);
  --solido: #111b21;
  --barra: #202c33;
  --linha: rgba(255, 255, 255, 0.08);
  --linha-forte: rgba(255, 255, 255, 0.16);
  --texto: #e9edef;
  --sutil: #8696a0;
  --marinho: #e9edef;
  --ouro: #e0b84a;
  --azul: #0a84ff;
  --hover: rgba(255, 255, 255, 0.05);
  --selecionado: #2a3942;
  --chat-fundo: #0b141a;
  --chat-ponto: rgba(255, 255, 255, 0.025);
  --bolha-in: #202c33;
  --bolha-out: #005c4b;
  --bolha-robo: #1f3554;
  --campo: #2a3942;
  --sombra: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --humano-cor: #ff9500;
  --aba-ativa: #3b4a54;
  --pend-fundo: #2b2614;
  --pend-texto: #f0d98a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fundo); }
[hidden] { display: none !important; }
::selection { background: rgba(0, 122, 255, 0.22); }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.2rem; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .8rem; }
code { font-family: var(--mono); font-size: .85em; background: var(--hover); padding: 1px 6px; border-radius: 6px; }
.sutil { color: var(--sutil); font-size: .9rem; }
.erro { color: var(--vermelho); min-height: 1.2em; margin: .5rem 0 0; font-size: .9rem; }

/* Barras de rolagem discretas */
* { scrollbar-width: thin; scrollbar-color: var(--linha-forte) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--linha-forte); border-radius: 6px; }

/* Campos */
input[type="search"], input[type="password"], input[type="text"], input[type="tel"], input[type="time"], textarea, select {
  font: inherit; font-size: .95rem; color: var(--texto); background: var(--campo); border: 1px solid var(--linha-forte); border-radius: 10px; padding: .55rem .75rem; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--sutil); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 4px rgba(0, 122, 255, .16); }
input[type="search"] { background: var(--barra); border-color: transparent; border-radius: 9px; }
input[type="checkbox"] { accent-color: var(--verde); width: 18px; height: 18px; }

/* Botões em formato de pílula */
.btn { font: inherit; font-size: .9rem; font-weight: 600; border: 0; border-radius: 999px; padding: .55rem 1.1rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; white-space: nowrap; transition: filter .15s, transform .1s, background .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(0, 122, 255, .25); }
.btn-ouro { background: var(--marinho); color: var(--solido); }
.btn-azul { background: var(--azul); color: #fff; }
.btn-claro { background: var(--hover); color: var(--texto); box-shadow: inset 0 0 0 1px var(--linha-forte); }
.btn-claro:hover:not(:disabled) { background: var(--selecionado); filter: none; }
.btn-finalizar { background: var(--verde); color: #fff; }
.btn-link { background: none; color: var(--azul); padding: .3rem 0; border-radius: 6px; }
.btn-perigo { background: none; color: var(--vermelho); padding: .3rem .6rem; }
.btn-perigo:hover:not(:disabled) { background: rgba(255, 59, 48, .08); filter: none; }

/* Marca da escola */
.marca { display: flex; gap: .7rem; align-items: center; }
.marca strong { display: block; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.marca small { color: var(--sutil); font-size: .78rem; }
.marca-selo { background: #0b1f3a; color: #e0b84a; font-weight: 800; border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; font-size: .78rem; letter-spacing: .5px; box-shadow: inset 0 0 0 1px rgba(224, 184, 74, .35); flex-shrink: 0; }
.marca-grande { flex-direction: column; text-align: center; margin-bottom: 1.6rem; }
.marca-grande .marca-selo { width: 64px; height: 64px; border-radius: 16px; font-size: 1.05rem; }
.marca-grande strong { font-size: 1.5rem; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 1rem; background: radial-gradient(1200px 600px at 50% -10%, rgba(0, 122, 255, .08), transparent 60%), var(--fundo); }
.login-card { width: min(380px, 100%); padding: 2.4rem 2rem 2rem; border-radius: 22px; display: grid; gap: .6rem; background: var(--painel); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--sombra); border: 1px solid var(--linha); }
.login-card label { font-weight: 500; color: var(--sutil); font-size: .85rem; }
.login-card .btn { margin-top: .6rem; padding: .75rem; }

/* Layout geral */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; }
.lateral { background: var(--painel); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--linha); padding: 1.2rem .8rem; display: flex; flex-direction: column; gap: 1.4rem; }
.lateral > .marca { padding: 0 .4rem; }
.lateral nav { display: grid; gap: 2px; }
.nav-item { font: inherit; font-size: .92rem; text-align: left; background: none; border: 0; color: var(--texto); padding: .55rem .7rem; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .4rem; transition: background .12s; }
.nav-item:hover { background: var(--hover); }
.nav-item.ativo { background: var(--selecionado); font-weight: 600; }
.badge { background: var(--verde); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 .4rem; display: inline-grid; place-items: center; }
.lateral-rodape { margin-top: auto; display: grid; gap: .5rem; padding: 0 .4rem; }
.tema .aba { font-size: .74rem; padding: .3rem .3rem; }
.conteudo { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.view { padding: 2rem 2.4rem; overflow-y: auto; height: 100%; }

/* Etiquetas de status */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; background: var(--hover); color: var(--sutil); white-space: nowrap; }
.pill.ok { background: rgba(0, 168, 132, .12); color: var(--verde); }
.pill.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--verde); }
.pill.alerta { background: rgba(255, 59, 48, .1); color: var(--vermelho); }
.pill.humano { background: rgba(255, 149, 0, .13); color: var(--humano-cor); }

/* Avatares (iniciais do contato) */
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 600; font-size: .95rem; color: #fff; background: #8e8e93; user-select: none; }
.avatar-c0 { background: linear-gradient(180deg, #5ac8fa, #007aff); }
.avatar-c1 { background: linear-gradient(180deg, #34c759, #00a884); }
.avatar-c2 { background: linear-gradient(180deg, #ffcc00, #ff9500); }
.avatar-c3 { background: linear-gradient(180deg, #ff6b81, #ff2d55); }
.avatar-c4 { background: linear-gradient(180deg, #bf5af2, #5e5ce6); }
.avatar-c5 { background: linear-gradient(180deg, #1e3a64, #0b1f3a); color: #e0b84a; }

/* ===== Conversas (layout do WhatsApp Web) ===== */
.view-conversas { display: grid; grid-template-columns: 380px minmax(0, 1fr); padding: 0; overflow: hidden; }
.lista { border-right: 1px solid var(--linha); background: var(--solido); display: flex; flex-direction: column; min-height: 0; }
.lista-topo { padding: .9rem .9rem .7rem; display: grid; gap: .65rem; }
/* Abas como "segmented control" do iOS */
.abas { display: flex; gap: 2px; background: var(--barra); padding: 2px; border-radius: 9px; }
.aba { flex: 1; font: inherit; font-size: .8rem; font-weight: 500; background: none; border: 0; color: var(--texto); padding: .35rem .5rem; border-radius: 7px; cursor: pointer; transition: background .15s; white-space: nowrap; }
.aba:hover { background: var(--hover); }
.aba.ativa { background: var(--aba-ativa); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.itens { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.item { padding: 0 .9rem; cursor: pointer; display: flex; align-items: center; gap: .8rem; transition: background .1s; }
.item:hover { background: var(--hover); }
.item.selecionado { background: var(--selecionado); }
.item-corpo { flex: 1; min-width: 0; padding: .75rem 0; border-bottom: 1px solid var(--linha); display: grid; gap: .2rem; }
.item-linha { display: flex; justify-content: space-between; gap: .5rem; align-items: center; min-width: 0; }
.item-nome { font-weight: 500; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-hora { color: var(--sutil); font-size: .74rem; flex-shrink: 0; }
.item-previa { color: var(--sutil); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.item.aguardando .item-hora { color: var(--verde); font-weight: 600; }
.item.aguardando .item-nome { font-weight: 700; }
.item.aguardando .item-nome::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: .4rem; border-radius: 50%; background: var(--verde); vertical-align: middle; }
.item-vazio { padding: 3rem 1rem; color: var(--sutil); text-align: center; }

.chat { display: flex; flex-direction: column; min-height: 0; background-color: var(--chat-fundo); background-image: radial-gradient(var(--chat-ponto) 1.2px, transparent 1.2px); background-size: 18px 18px; }
.vazio { margin: auto; color: var(--sutil); text-align: center; font-size: .95rem; padding: 2rem; }
.vazio::before { content: "💬"; display: block; font-size: 3rem; margin-bottom: .6rem; opacity: .6; }
.chat-ativo { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-topo { background: var(--barra); border-bottom: 1px solid var(--linha); padding: .55rem 1.1rem; display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; min-height: 62px; }
.chat-id { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.chat-id .avatar { width: 40px; height: 40px; font-size: .85rem; }
.chat-topo h2 { margin: 0 0 .1rem; font-size: 1rem; font-weight: 600; }
.chat-topo .sutil { margin-right: .5rem; font-size: .8rem; }
.acoes { display: flex; gap: .4rem; flex-wrap: wrap; }
.acoes .btn { padding: .4rem .8rem; font-size: .82rem; }
.pendencias { background: var(--pend-fundo); border-bottom: 1px solid rgba(201, 162, 39, .35); padding: .6rem 1.2rem; font-size: .88rem; color: var(--pend-texto); display: grid; gap: .25rem; }
.mensagens { flex: 1; overflow-y: auto; padding: 1.2rem 6% 1rem; display: flex; flex-direction: column; gap: .3rem; }
.msg { position: relative; max-width: min(65%, 560px); padding: .4rem .55rem .3rem .6rem; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; font-size: .93rem; box-shadow: var(--sombra-bolha); animation: entrar .18s ease-out; }
.msg small { display: block; text-align: right; margin-top: .1rem; font-size: .68rem; color: var(--sutil); }
.msg-cliente { background: var(--bolha-in); align-self: flex-start; border-top-left-radius: 0; }
.msg-robo { background: var(--bolha-robo); align-self: flex-end; border-top-right-radius: 0; }
.msg-equipe { background: var(--bolha-out); align-self: flex-end; border-top-right-radius: 0; }
/* "Rabinho" das bolhas, como no WhatsApp */
.msg-cliente::before, .msg-robo::before, .msg-equipe::before { content: ""; position: absolute; top: 0; width: 8px; height: 10px; }
.msg-cliente::before { left: -7px; background: var(--bolha-in); clip-path: polygon(100% 0, 0 0, 100% 100%); }
.msg-robo::before { right: -7px; background: var(--bolha-robo); clip-path: polygon(0 0, 100% 0, 0 100%); }
.msg-equipe::before { right: -7px; background: var(--bolha-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
@keyframes entrar { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.compositor { display: flex; gap: .6rem; align-items: flex-end; padding: .6rem 1rem .3rem; background: var(--barra); }
.compositor textarea { resize: none; min-height: 42px; max-height: 160px; border-radius: 10px; border-color: transparent; padding: .6rem .9rem; line-height: 1.35; }
.compositor button[type="submit"] { background: var(--verde); color: #fff; height: 42px; padding: 0 1.2rem; }
.compositor .btn-icone { height: 42px; width: 42px; font-size: 1.1rem; }
.dica { margin: 0; padding: .1rem 1rem .6rem; background: var(--barra); color: var(--sutil); font-size: .74rem; }

/* Fotos, vídeos, áudios e documentos nas conversas */
.msg-com-midia { padding: .25rem .25rem .3rem; }
.msg-legenda { padding: .3rem .35rem 0; }
.msg-com-midia small { padding: 0 .35rem; }
.midia { position: relative; }
.msg-img { display: block; max-width: min(330px, 100%); max-height: 360px; border-radius: 6px; cursor: zoom-in; object-fit: cover; background: var(--barra); }
.msg-video { display: block; width: min(360px, 100%); max-height: 360px; border-radius: 6px; background: #000; }
.msg-audio { display: block; width: min(300px, 70vw); height: 40px; }
.midia-baixar { display: inline-block; margin: .3rem .35rem 0; font-size: .74rem; color: var(--azul); text-decoration: none; }
.midia-baixar:hover { text-decoration: underline; }
.midia-aviso { font-size: .85rem; color: var(--sutil); padding: .35rem .4rem; }
.msg-doc { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 6px; background: var(--hover); color: var(--texto); text-decoration: none; min-width: 220px; }
.msg-doc:hover { background: var(--selecionado); }
.doc-icone { font-size: 1.6rem; }
.doc-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.doc-abrir { color: var(--azul); font-size: .82rem; font-weight: 600; }
.visualizador { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .88); display: grid; place-items: center; padding: 2rem; cursor: zoom-out; }
.visualizador img { max-width: 100%; max-height: calc(100vh - 6rem); border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.visualizador-baixar { position: fixed; top: 1rem; right: 1rem; background: rgba(255, 255, 255, .92); color: #1d1d1f; }

/* Arquivo anexado antes de enviar */
.anexo { display: flex; align-items: center; gap: .8rem; margin: 0 1rem; padding: .6rem .8rem; background: var(--solido); border: 1px solid var(--linha); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 20px rgba(0, 0, 0, .06); }
.anexo-miniatura { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--barra); display: grid; place-items: center; font-size: 1.8rem; flex-shrink: 0; }
.anexo-miniatura img, .anexo-miniatura video { width: 100%; height: 100%; object-fit: cover; }
.anexo-info { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.anexo-info b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo-info span { font-size: .78rem; }
.chat.arrastando { outline: 3px dashed var(--verde); outline-offset: -10px; }

/* Botão só com ícone */
.btn-icone { width: 38px; height: 38px; padding: 0; flex-shrink: 0; }

/* Busca + nova conversa */
.busca-linha { display: flex; gap: .5rem; align-items: center; }
.nova-conversa { display: flex; gap: .5rem; }
.item-novo .avatar { font-size: 1.2rem; }

/* Menu do botão direito (estilo macOS) */
.menu-contexto { position: fixed; z-index: 20; min-width: 210px; padding: 5px; border-radius: 10px; background: var(--painel); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 0 0 .5px var(--linha-forte); display: grid; }
.menu-opcao { font: inherit; font-size: .88rem; text-align: left; background: none; border: 0; color: var(--texto); padding: .45rem .7rem; border-radius: 6px; cursor: pointer; }
.menu-opcao:hover, .menu-opcao:focus-visible { background: var(--azul); color: #fff; outline: none; }
.menu-perigo { color: var(--vermelho); }

/* Respostas rápidas */
.rapidas { margin: 0 1rem; max-height: 240px; overflow-y: auto; background: var(--solido); border-radius: 12px 12px 0 0; box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); border: 1px solid var(--linha); border-bottom: 0; display: grid; }
.rapida { font: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--linha); color: var(--texto); padding: .55rem .9rem; cursor: pointer; display: grid; gap: .1rem; }
.rapida b { font-size: .82rem; color: var(--verde); }
.rapida span { font-size: .86rem; color: var(--sutil); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rapida:hover, .rapida.ativa { background: var(--selecionado); }
.rapida-vazia { padding: .8rem 1rem; color: var(--sutil); font-size: .86rem; }
input.campo-atalho { width: 140px; }
.tabela textarea { min-height: 44px; resize: vertical; }

/* Status do WhatsApp */
.grade-status { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.4rem; max-width: 980px; align-items: start; }
.grade-status .cartao { margin-bottom: 0; }
.status-form { display: grid; gap: .8rem; margin-top: 1rem; }
.status-form textarea { resize: vertical; }
.escolher-arquivo { justify-self: start; }
.cores { display: flex; gap: .5rem; flex-wrap: wrap; }
.cor { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--linha-forte); }
.cor.ativa { border-color: var(--solido); box-shadow: 0 0 0 2px var(--azul); }
.cor-0 { background: #0b1f3a; } .cor-1 { background: #c9a227; } .cor-2 { background: #00a884; } .cor-3 { background: #007aff; }
.cor-4 { background: #ff2d55; } .cor-5 { background: #5e5ce6; } .cor-6 { background: #1d1d1f; }
.previa-status-wrap { position: sticky; top: 1rem; }
.previa-status { aspect-ratio: 9 / 16; border-radius: 22px; display: grid; place-items: center; padding: 1.4rem; color: #fff; text-align: center; font-size: 1.15rem; font-weight: 400; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; position: relative; box-shadow: var(--sombra); }
.previa-negrito { font-weight: 700; }
.abas-fonte { max-width: 280px; }
.previa-foto { background: #000; padding: 0; }
.previa-foto img, .previa-foto video { width: 100%; height: 100%; object-fit: contain; }
.dica-status { margin: -.3rem 0 0; font-size: .8rem; }
.legenda-previa { position: absolute; left: 0; right: 0; bottom: 0; padding: .8rem; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); font-size: .9rem; font-weight: 500; }
.lista-simples { list-style: none; margin: 0; padding: 0; display: grid; }
.lista-simples li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--linha); }
.lista-simples li:last-child { border-bottom: 0; }
.lista-simples li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-simples li small { flex-shrink: 0; }

/* ===== Tabelas e cartões (estilo Ajustes do macOS) ===== */
.tabela-wrap { overflow-x: auto; background: var(--solido); border-radius: var(--raio); box-shadow: var(--sombra); border: 1px solid var(--linha); }
.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th { text-align: left; color: var(--sutil); padding: .7rem .85rem; font-weight: 500; white-space: nowrap; font-size: .78rem; border-bottom: 1px solid var(--linha); }
.tabela td { padding: .6rem .85rem; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover td { background: var(--hover); }
.tabela-compacta td { padding: .45rem .6rem; }
.tabela select { width: auto; padding: .35rem .55rem; }
.cartao { background: var(--solido); border-radius: var(--raio); box-shadow: var(--sombra); border: 1px solid var(--linha); padding: 1.3rem 1.5rem; margin-bottom: 1.4rem; max-width: 980px; }
.cartao .tabela th:first-child, .cartao .tabela td:first-child { padding-left: 0; }
.cartoes { display: grid; gap: .9rem; margin-top: 1rem; max-width: 980px; }
.texto-cartao { background: var(--solido); border-radius: var(--raio); box-shadow: var(--sombra); border: 1px solid var(--linha); padding: 1rem 1.2rem; display: grid; gap: .55rem; }
.texto-cartao header { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.texto-cartao header strong { text-transform: capitalize; font-weight: 600; }
.texto-cartao textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
#busca-textos { max-width: 420px; }
.linha-botoes { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.dia { display: grid; grid-template-columns: 120px 1fr; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--linha); align-items: center; }
.dia:last-child { border-bottom: 0; }
.dia strong { font-weight: 500; }
.intervalos { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.intervalo { display: flex; gap: .35rem; align-items: center; background: var(--barra); padding: .25rem .4rem; border-radius: 10px; color: var(--sutil); font-size: .85rem; }
.intervalo input { width: 124px; padding: .3rem .45rem; }
input.campo-numero { width: 56px; text-align: center; }

/* Situação */
.grade-numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; max-width: 980px; }
.numero { background: var(--solido); border-radius: var(--raio); box-shadow: var(--sombra); border: 1px solid var(--linha); padding: 1rem 1.2rem; }
.numero b { display: block; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.numero:first-child b { font-size: 1.15rem; line-height: 2rem; overflow-wrap: normal; }
.numero span { color: var(--sutil); font-size: .84rem; }
#qr { width: 300px; max-width: 100%; display: block; margin: 1.2rem auto 0; border: 12px solid #fff; border-radius: 18px; box-shadow: var(--sombra); }

/* Aviso flutuante */
.toast { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); background: rgba(29, 29, 31, .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: #fff; padding: .75rem 1.2rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: min(420px, calc(100vw - 2rem)); z-index: 10; font-size: .9rem; animation: subir .2s ease-out; }
.toast.erro-toast { background: rgba(255, 59, 48, .95); }
@keyframes subir { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .lateral { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem 1rem; border-right: 0; border-bottom: 1px solid var(--linha); }
  .lateral nav { display: flex; flex-wrap: wrap; }
  .lateral-rodape { margin: 0 0 0 auto; display: flex; align-items: center; }
  .view-conversas { grid-template-columns: 1fr; height: auto; }
  .lista { max-height: 45vh; border-right: 0; }
  .chat { min-height: 65vh; }
  .mensagens { padding: 1rem; }
  .msg { max-width: 88%; }
  .grade-status { grid-template-columns: 1fr; }
  .previa-status-wrap { max-width: 260px; }
  .view { padding: 1rem; }
}
