/* Mini-Zord · painel — linguagem do site do Grupo Reis: preto, dourado, vidro fosco, serifa nos títulos. */
@font-face { font-family: 'Plus Jakarta Sans'; src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url(/fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url(/fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }

:root {
  /* Design system: troque aqui para re-pintar tudo */
  --bg: #000000;
  --surface: rgba(10, 10, 10, .62);
  --surface-solid: #0b0b0b;
  --surface-2: #121212;
  --primary: #d4af37;
  --primary-rgb: 212, 175, 55;
  --primary-2: #b38728;
  --on-primary: #0a0a0a;
  --primary-soft: rgba(var(--primary-rgb), .11);
  --primary-line: rgba(var(--primary-rgb), .24);
  --text: #f4f2ec;
  --text-2: #b0b0b0;
  --text-3: #7d7d7d;
  --line: rgba(255, 255, 255, .08);
  --ok: #4cc38a;
  --danger: #e5604f;
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-pill: 999px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --shadow: 0 30px 60px rgba(0, 0, 0, .55);
  --field: #0d0d0d; --card: #131313; --track: #262626; --glass-blur: 20px; --accent: #d4af37;
  --bolha-in: #131313; --bolha-out: #3a2f0e; --chat-bg: rgba(0, 0, 0, .5);
  --fundo-grad: radial-gradient(1000px 640px at 14% 6%, rgba(212, 175, 55, .13), transparent 60%), radial-gradient(800px 560px at 92% 94%, rgba(212, 175, 55, .07), transparent 62%), #000;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: transparent; color: var(--text); font: 400 15px/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.serif { font-family: var(--font-serif); }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }

/* ---------- botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 20px; border: 0; border-radius: var(--radius-s); background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); font-weight: 650; cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s, opacity .18s; }
.btn:hover { box-shadow: 0 10px 28px rgba(var(--primary-rgb), .22); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled] { opacity: .5; cursor: default; box-shadow: none; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--primary-line); }
.btn.ghost:hover { background: var(--primary-soft); box-shadow: none; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(229, 96, 79, .4); }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 13px; color: var(--text-3); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s); outline: none; transition: border-color .18s, box-shadow .18s;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18); outline: none; }
input[type=color] { width: 52px; height: 44px; padding: 3px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: var(--radius-s); color: var(--text-2); cursor: pointer; }
.eye:hover { color: var(--text); }
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.switch .track { width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--track); border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #d8d8d8; transition: transform .25s var(--ease), background .2s; }
.switch input:checked + .track { background: var(--primary-soft); border-color: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--primary); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 1.15fr .85fr; min-height: 100dvh; }
.login-brand { padding: clamp(32px, 6vw, 88px); display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); position: relative; overflow: hidden; }
.login-brand h1 { font: 500 clamp(40px, 5.2vw, 76px)/1.02 var(--font-serif); max-width: 14ch; }
.login-brand p { color: var(--text-2); max-width: 38ch; margin-top: 22px; font-size: 16.5px; }
.gold-rule { height: 1px; width: 0; background: linear-gradient(90deg, var(--primary), transparent); margin: 28px 0; animation: draw 1.4s .15s var(--ease) forwards; }
@keyframes draw { to { width: min(320px, 60%); } }
.login-form { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: min(400px, 100%); display: grid; gap: 18px; }
.login-card h2 { font: 500 34px/1.1 var(--font-serif); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-brand { border: 0; padding: 36px 24px 8px; } .login-brand h1 { font-size: 42px; } .login-brand p { display: none; } .gold-rule { margin: 16px 0 0; } }

/* ---------- estrutura ---------- */
.mark { display: flex; align-items: center; gap: 12px; }
.mark svg { width: 34px; height: 34px; flex: none; }
.mark b { font: 600 24px/1 var(--font-serif); letter-spacing: .2px; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.shell > div, .main, .inbox > *, .section > * { min-width: 0; }
.avatar svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linecap: round; }
.chip { justify-self: start; }
.login-card { padding: 36px; background: var(--surface); border: 1px solid var(--primary-line); border-radius: var(--radius-m); backdrop-filter: blur(var(--glass-blur)); box-shadow: var(--shadow); }
.rail { position: sticky; top: 0; height: 100dvh; padding: 28px 18px 22px; display: flex; flex-direction: column; gap: 30px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-s); color: var(--text-2); text-decoration: none; font-weight: 550; transition: background .18s, color .18s; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav a[aria-current=page] { color: var(--text); background: var(--primary-soft); box-shadow: inset 2px 0 0 var(--primary); }
.nav svg, .tabbar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; text-align: center; }
.rail-foot { margin-top: auto; display: grid; gap: 12px; font-size: 13.5px; }
.rail-foot .who { color: var(--text-2); overflow-wrap: anywhere; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.linkbtn:hover { color: var(--text); }
.main { padding: 40px clamp(20px, 4vw, 56px) 80px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font: 500 clamp(32px, 3.6vw, 46px)/1.05 var(--font-serif); }
.page-head p { color: var(--text-2); margin-top: 8px; max-width: 56ch; }
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 6px 6px max(6px, env(safe-area-inset-bottom)); background: rgba(8, 8, 8, .82); backdrop-filter: blur(20px); border-top: 1px solid var(--primary-line); }
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 8px 2px; min-height: 52px; color: var(--text-3); text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative; }
.tabbar a[aria-current=page] { color: var(--primary); }
.tabbar .count { position: absolute; top: 2px; left: 55%; margin: 0; min-width: 18px; padding: 0 5px; font-size: 11px; }
.topbar { display: none; align-items: center; justify-content: space-between; padding: max(14px, env(safe-area-inset-top)) 16px 10px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); } .rail { display: none; } .tabbar { display: flex; } .topbar { display: flex; }
  .login-card { padding: 24px; }
  .main { padding: 8px 16px 110px; }
}
.switcher { display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin-bottom: 22px; border: 1px solid var(--primary-line); border-radius: var(--radius-pill); background: var(--primary-soft); font-size: 13.5px; width: fit-content; max-width: 100%; }

/* ---------- vidro e seções ---------- */
.glass { background: var(--surface); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--primary-line); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.section { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 28px; padding: 28px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; padding-top: 0; }
.section h2 { font: 600 24px/1.15 var(--font-serif); }
.section .desc { color: var(--text-2); font-size: 14px; margin-top: 8px; }
.stack { display: grid; gap: 18px; min-width: 0; }
@media (max-width: 800px) { .section { grid-template-columns: 1fr; gap: 16px; } }
.savebar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; margin-top: 12px; transform: translateY(24px); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .25s; }
.savebar.on { transform: none; opacity: 1; pointer-events: auto; }
@media (max-width: 900px) { .savebar { bottom: 84px; } }

/* ---------- atendimentos ---------- */
.hero { margin-bottom: 26px; }
.hero .n { font: 500 clamp(64px, 9vw, 112px)/.9 var(--font-serif); color: var(--primary); }
.hero-line { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.hero h1 { font: 500 clamp(28px, 3.2vw, 42px)/1.18 var(--font-serif); padding-bottom: 8px; }
.hero p { color: var(--text-2); margin-top: 10px; }
.filters { display: flex; gap: 22px; overflow-x: auto; margin-bottom: 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { background: none; border: 0; padding: 10px 0; color: var(--text-3); font-weight: 600; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed=true] { color: var(--text); border-bottom-color: var(--primary); }
.inbox { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); overflow: hidden; min-height: 560px; height: calc(100dvh - 330px); max-height: 760px; }
.list { overflow-y: auto; border-right: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: start; width: 100%; padding: 14px 16px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; transition: background .15s; }
.row:hover { background: rgba(255, 255, 255, .03); }
.row[aria-selected=true] { background: var(--primary-soft); box-shadow: inset 2px 0 0 var(--primary); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); font: 600 20px/1 var(--font-serif); color: var(--primary); flex: none; }
.row .nm { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sn { color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .tm { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.s-aguardando_humano .dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .16); }
.s-aguardando_humano { color: var(--primary); font-weight: 600; }
.s-em_atendimento .dot { background: #cfcfcf; }
.s-humano_assumiu .dot, .s-concluido .dot { background: var(--ok); }
.s-concluido { color: var(--text-3); }
.s-sem_resposta_limite .dot { background: var(--danger); }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.thread-head h2 { font: 600 24px/1.1 var(--font-serif); }
.thread-head .sub { color: var(--text-2); font-size: 13.5px; }
.back { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; cursor: pointer; }
.back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: min(78%, 560px); padding: 10px 14px; border-radius: var(--radius-m); white-space: pre-wrap; overflow-wrap: anywhere; animation: rise .28s var(--ease); }
.bubble small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.bubble.in { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.ia { align-self: flex-end; background: var(--primary-soft); border: 1px solid var(--primary-line); border-bottom-right-radius: 4px; }
.bubble.humano { align-self: flex-end; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.bubble.falhou small { color: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.thread-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.reply { display: flex; gap: 10px; }
.empty { display: grid; place-items: center; text-align: center; color: var(--text-2); padding: 48px 24px; flex: 1; }
.empty h3 { font: 500 28px/1.15 var(--font-serif); color: var(--text); margin-bottom: 8px; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; border: 0; background: none; box-shadow: none; backdrop-filter: none; height: auto; max-height: none; min-height: 0; }
  .list { border: 0; overflow: visible; }
  .row { padding: 14px 4px; }
  .thread { position: fixed; inset: 0; z-index: 40; background: var(--bg); transform: translateX(100%); transition: transform .34s var(--ease); visibility: hidden; }
  .thread.open { transform: none; visibility: visible; }
  .back { display: block; }
  .thread-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}

/* ---------- tabelas, listas e blocos de código ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .num { font: 500 26px/1 var(--font-serif); }
.tablewrap { overflow-x: auto; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.chip.ok { color: var(--ok); border-color: rgba(76, 195, 138, .4); }
.chip.warn { color: var(--primary); border-color: var(--primary-line); }
.chip.bad { color: var(--danger); border-color: rgba(229, 96, 79, .4); }
.code { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s); font: 13px/1.45 ui-monospace, 'Cascadia Code', Consolas, monospace; color: var(--text-2); }
.code span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-plain { display: grid; }
.list-plain > div { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-plain > div:last-child { border-bottom: 0; }
.list-plain > div > :first-child { flex: 1; min-width: 0; }
.thread-head > div:last-child { flex: 1; min-width: 0; }
.termo { display: grid; gap: 14px; }
.termo b { display: block; font-weight: 650; }
.termo p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.phone-frame { width: min(300px, 100%); aspect-ratio: 9 / 18; border: 1px solid var(--primary-line); border-radius: 34px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.phone-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.steps { padding-left: 20px; margin: 0; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; }
.notice { font-size: 13px; color: var(--text-3); padding-top: 24px; border-top: 1px solid var(--line); margin-top: 10px; }

/* ---------- janela e avisos ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); animation: fade .2s; }
.modal { width: min(460px, 100%); padding: 28px; display: grid; gap: 16px; background: var(--surface-solid); }
.modal h2 { font: 600 28px/1.1 var(--font-serif); }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 12px 20px; border-radius: var(--radius-pill); background: rgba(12, 12, 12, .92); backdrop-filter: blur(16px); border: 1px solid var(--primary-line); box-shadow: var(--shadow); animation: rise .3s var(--ease); font-size: 14.5px; }
.toast.err { border-color: rgba(229, 96, 79, .5); color: #ffb3a8; }
@media (max-width: 900px) { #toasts { bottom: 90px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } .gold-rule { width: min(320px, 60%); } }
