/* Agenda Fácil — protótipo da vitrine.
   Tokens do painel real (app/static/painel.css) + o chat escuro da landing (docs/landing). */
:root {
  --azul: #2d6cdf; --azul-escuro: #1b4fb0; --azul-50: #eff6ff; --azul-100: #dbeafe;
  --azul-sidebar: #14315f;
  --cinza-50: #f9fafb; --cinza-100: #f3f4f6; --cinza-200: #e5e7eb; --cinza-300: #d1d5db;
  --cinza-400: #9ca3af; --cinza-500: #6b7280; --cinza-600: #4b5563; --cinza-700: #374151; --cinza-800: #1f2937;
  --verde-100: #dcfce7; --verde-700: #15803d; --vermelho-100: #fee2e2; --vermelho-700: #b91c1c;
  --wa: #25d366;
  --fundo: #eef1f6;
  --raio: 10px;
  --bar-h: 36px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fundo); color: var(--cinza-800); font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- faixa do protótipo ---------- */
.demo-bar { background: #0b3d2e; color: #d1fae5; font-size: 12.5px; padding: 7px 16px; display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.demo-bar strong { color: #fff; }
.demo-bar span { flex: 1; min-width: 0; }
.demo-bar .txt-cel { display: none; }
.demo-bar button { background: transparent; border: 1px solid rgba(209,250,229,.45); color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.demo-bar button:hover { background: rgba(255,255,255,.1); }

.abas { display: none; }

.palco { flex: 1; min-height: 0; display: flex; }

/* ---------- lado do chat ---------- */
.lado-chat { width: 410px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 20px 10px;
  background: linear-gradient(160deg, #0f2a4d 0%, #14315f 55%, #0b3d2e 100%); }
.fone { width: 100%; max-width: 370px; flex: 1; min-height: 0; max-height: 780px; display: flex; flex-direction: column; background: #0b141a; border: 9px solid #1d2a44; border-radius: 34px; overflow: hidden; box-shadow: 0 24px 50px rgba(0,0,0,.4); }
.fone-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #1f2c33; color: #e9edef; flex-shrink: 0; }
.fone-av { width: 36px; height: 36px; border-radius: 50%; background: var(--azul); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.fone-id b { display: block; font-size: 14px; font-weight: 600; }
.fone-id small { color: #8fa3ad; font-size: 11.5px; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px;
  background-color: #0b141a; background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 16px 16px; }
.msg { max-width: 86%; padding: 7px 10px 5px; border-radius: 10px; line-height: 1.4; color: #e9edef; font-size: 13.5px; overflow-wrap: anywhere; }
.msg.in { background: #202c33; align-self: flex-start; border-top-left-radius: 3px; }
.msg.out { background: #005c4b; align-self: flex-end; border-top-right-radius: 3px; }
.msg b { color: #fff; }
.msg time { display: block; text-align: right; font-size: 10.5px; color: #9fb0b8; margin-top: 2px; }
.msg .vistos { color: #53bdeb; }
.msg.digitando { display: flex; gap: 4px; padding: 11px 13px; }
.msg.digitando i { width: 6px; height: 6px; border-radius: 50%; background: #8fa3ad; animation: pulo 1s infinite; }
.msg.digitando i:nth-child(2) { animation-delay: .15s; } .msg.digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pulo { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-vazio { margin: auto 8px; text-align: center; color: #8fa3ad; font-size: 13px; background: #182229; border-radius: 10px; padding: 12px 14px; }
.chat-vazio b { color: #e9edef; }
.respostas { flex-shrink: 0; max-height: 46%; overflow-y: auto; padding: 8px 10px 12px; background: #111b21; border-top: 1px solid #1f2c33; display: flex; flex-direction: column; gap: 6px; }
.respostas:empty { display: none; }
.respostas.grade { display: grid; grid-template-columns: repeat(4, 1fr); }
.respostas.grade .resp:nth-last-child(1) { grid-column: 1 / -1; }
.resp { background: #202c33; color: #53bdeb; border: 1px solid #2a3942; border-radius: 18px; padding: 8px 12px; font-size: 13px; font-weight: 500; text-align: center; }
.resp:hover { background: #2a3942; }
.resp-ver { background: var(--wa); color: #0b141a; border-color: var(--wa); font-weight: 600; }
.resp-ver:hover { background: #3be07a; }
.nota-chat { color: #a7c4d8; font-size: 11.5px; margin: 8px 0 0; text-align: center; max-width: 340px; }

/* ---------- lado do painel ---------- */
.lado-painel { flex: 1; min-width: 0; display: flex; position: relative; }
.sb { width: 210px; flex-shrink: 0; background: var(--azul-sidebar); color: #cbd5e1; display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px 12px; color: #fff; font-weight: 700; font-size: 16px; }
.clinica { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #8ea3c4; padding: 8px 8px 12px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }
.clinica b { display: block; text-transform: none; letter-spacing: 0; color: #fff; font-size: 13px; font-weight: 600; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #cbd5e1; text-decoration: none; font-size: 13.5px; background: none; border: 0; text-align: left; width: 100%; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.ativo { background: var(--azul); color: #fff; font-weight: 600; }
.nav-item.lock { font-size: 12px; color: #8ea3c4; padding: 6px 10px; white-space: nowrap; }
.nav-item.lock span { overflow: hidden; text-overflow: ellipsis; }
.nav-item.lock svg { flex-shrink: 0; opacity: .8; }
.nav-grupo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #8ea3c4; padding: 16px 10px 6px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 12px 8px 2px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--verde-700); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.sb-user .n { color: #fff; font-weight: 600; font-size: 13px; } .sb-user .r { font-size: 11.5px; color: #8ea3c4; }
.scrim { display: none; }

.pn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pn-top { height: 52px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--cinza-200); display: flex; align-items: center; gap: 10px; padding: 0 20px; }
.pn-top h1 { font-size: 17px; margin: 0; font-weight: 600; }
.menu-btn { display: none; background: none; border: 1px solid var(--cinza-200); border-radius: 8px; padding: 6px; color: var(--cinza-700); }
.pn-main { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; background: var(--cinza-50); }

/* ---------- componentes ---------- */
.card { background: #fff; border: 1px solid var(--cinza-200); border-radius: var(--raio); padding: 16px; margin-bottom: 14px; }
.card.sem-pad { padding: 0; overflow: hidden; }
.btn-sec { background: #fff; border: 1px solid var(--cinza-300); color: var(--cinza-700); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.btn-sec:hover { background: var(--cinza-100); }
.btn-ico { background: #fff; border: 1px solid var(--cinza-300); color: var(--cinza-700); border-radius: 8px; width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.btn-ico:hover { background: var(--cinza-100); }
.btn-perigo { background: var(--vermelho-700); color: #fff; border: 0; border-radius: 8px; padding: 7px 13px; font-size: 13px; font-weight: 600; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag.ok { background: var(--verde-100); color: var(--verde-700); }
.tag.cancel { background: var(--vermelho-100); color: var(--vermelho-700); }
.rot { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.campo { width: 100%; border: 1px solid var(--cinza-300); border-radius: 8px; padding: 9px 12px; font: inherit; }
.campo:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(45,108,223,.15); }
.dica { margin: 8px 0 0; color: var(--cinza-500); font-size: 12.5px; }
.link { background: none; border: 0; padding: 0; color: var(--azul); font-weight: 600; text-decoration: underline; }
.nota { color: var(--cinza-500); font-size: 12.5px; margin: 0; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--cinza-500); background: var(--cinza-50); padding: 9px 14px; border-bottom: 1px solid var(--cinza-200); }
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--cinza-100); vertical-align: middle; }
.tbl td small { display: block; color: var(--cinza-500); font-size: 11.5px; }
.tbl tbody tr[data-ev] { cursor: pointer; } .tbl tbody tr[data-ev]:hover { background: var(--azul-50); }
.tbl .vazio { text-align: center; color: var(--cinza-500); padding: 18px; }
.pessoa { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; margin-right: 6px; }
.pessoa i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ---------- agenda ---------- */
.ag-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ag-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ag-rotulo { font-weight: 600; font-size: 14.5px; margin-left: 6px; display: inline-block; }
.ag-rotulo::first-letter { text-transform: uppercase; }
.seg { display: inline-flex; border: 1px solid var(--cinza-300); border-radius: 8px; overflow: hidden; }
.seg button { background: #fff; border: 0; padding: 6px 12px; font-size: 13px; color: var(--cinza-600); }
.seg button + button { border-left: 1px solid var(--cinza-300); }
.seg button.on { background: var(--azul); color: #fff; font-weight: 600; }
.ag-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--cinza-300); background: #fff; color: var(--cinza-500); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--c); }
.chip.on { color: var(--cinza-800); border-color: var(--c); font-weight: 600; }
.chip.on i { background: var(--c); }
.ag-resumo { margin-left: auto; color: var(--cinza-500); font-size: 12.5px; }

.g-wrap { background: #fff; border: 1px solid var(--cinza-200); border-radius: var(--raio); overflow-x: auto; }
.g { min-width: calc(46px + var(--cols) * 96px); }
.g-cab, .g-corpo { display: flex; }
.g-cab { border-bottom: 1px solid var(--cinza-200); position: sticky; top: 0; background: #fff; z-index: 3; }
.g-canto { width: 46px; flex-shrink: 0; }
.g-col-cab { flex: 1; min-width: 0; padding: 7px 8px; border-left: 1px solid var(--cinza-200); border-bottom: 3px solid transparent; text-align: center; }
.g-col-cab b { display: block; font-size: 13px; }
.g-col-cab small { color: var(--cinza-500); font-size: 11px; }
.g-col-cab.hoje b { color: var(--azul); }
.g-horas { width: 46px; flex-shrink: 0; }
.hora { font-size: 10.5px; color: var(--cinza-400); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.hora:first-child { transform: none; }
.g-col { flex: 1; min-width: 0; position: relative; border-left: 1px solid var(--cinza-200);
  background-image: repeating-linear-gradient(to bottom, var(--cinza-200) 0 1px, transparent 1px 26px, var(--cinza-100) 26px 27px, transparent 27px 52px); }
.g-col.hoje { background-color: #fbfdff; }
.g-bloco { position: absolute; left: 0; right: 0; z-index: 0; }
.g-bloco.fechado { background: repeating-linear-gradient(45deg, var(--cinza-100) 0 6px, #fff 6px 12px); }
.g-bloco.almoco { background: var(--cinza-100); color: var(--cinza-400); font-size: 10.5px; text-align: center; padding-top: 4px; }
.ev { position: absolute; left: 3px; right: 3px; z-index: 1; border: 0; border-left: 3px solid var(--c); background: var(--f); border-radius: 5px; padding: 3px 6px; text-align: left; overflow: hidden; display: flex; flex-direction: column; gap: 1px; color: var(--cinza-800); }
.ev:hover { filter: brightness(.96); }
.ev-l1 { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.ev-l2 { font-size: 10.5px; color: var(--cinza-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.curto { flex-direction: row; align-items: center; padding-block: 0; }
.ev.curto .ev-l2 { display: none; }
.ev.passado { opacity: .55; }
.ev.destaque { z-index: 2; box-shadow: 0 0 0 2px var(--wa), 0 6px 16px rgba(37,211,102,.35); animation: brilho 1.4s ease-in-out 3; }
@keyframes brilho { 50% { box-shadow: 0 0 0 4px var(--wa), 0 6px 22px rgba(37,211,102,.55); } }
i.wa { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wa); flex-shrink: 0; }
.legenda { color: var(--cinza-500); font-size: 12px; margin: 8px 0 0; display: flex; align-items: center; gap: 6px; }

/* ---------- modal e toast ---------- */
.modal-fundo { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 420px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.m-cab { border-left: 4px solid var(--c); padding-left: 12px; margin-bottom: 14px; }
.m-cab h2, .m-tit { margin: 0; font-size: 17px; }
.m-cab small { color: var(--cinza-500); }
.m-txt { color: var(--cinza-600); margin: 8px 0 0; }
.m-dados { display: grid; grid-template-columns: 96px 1fr; gap: 7px 10px; margin: 0; font-size: 13.5px; }
.m-dados dt { color: var(--cinza-500); } .m-dados dd { margin: 0; }
.m-rod { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.aviso-cad { width: 44px; height: 44px; border-radius: 12px; background: var(--azul-50); color: var(--azul); display: grid; place-items: center; margin-bottom: 10px; }
.aviso-rod { margin: 12px 0 0; font-size: 12.5px; color: var(--verde-700); font-weight: 600; }
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--cinza-800); color: #fff; border-left: 4px solid var(--wa); border-radius: 10px; padding: 10px 14px; font-size: 13px; max-width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none; z-index: 60; }
.toast.on { opacity: 1; transform: none; }

/* ---------- telas médias: chat mais estreito ---------- */
@media (max-width: 1240px) and (min-width: 1001px) {
  .lado-chat { width: 360px; padding-inline: 14px; }
  .sb { width: 186px; }
}

/* ---------- celular: abas ---------- */
@media (max-width: 1000px) {
  .demo-bar { padding: 6px 12px; gap: 10px; }
  .demo-bar .txt-pc { display: none; } .demo-bar .txt-cel { display: block; }
  .abas { display: flex; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--cinza-200); }
  .abas button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 6px; font-size: 13.5px; font-weight: 600; color: var(--cinza-500); position: relative; }
  .abas button.on { color: var(--azul); border-bottom-color: var(--azul); }
  .abas i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wa); margin-left: 4px; vertical-align: middle; }
  body[data-aba="chat"] .lado-painel { display: none; }
  body[data-aba="painel"] .lado-chat { display: none; }
  .lado-chat { width: 100%; padding: 0; background: #0b141a; }
  .fone { max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  .nota-chat { margin: 0; padding: 6px 12px 8px; max-width: none; background: #111b21; width: 100%; }
  .sb { position: fixed; top: var(--bar-h); bottom: 0; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; width: 240px; }
  body.menu-aberto .sb { transform: none; }
  body.menu-aberto .scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 39; }
  .menu-btn { display: inline-flex; }
  .pn-top { padding: 0 12px; }
  .pn-main { padding: 12px 12px 20px; }
  .ag-rotulo { font-size: 13.5px; }
  .ag-resumo { margin-left: 0; width: 100%; }
  .esconde-cel { display: none; }
  .tbl th, .tbl td { padding: 8px 10px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
