/* =====================================================================
   Aurora Concierge IA — interface premium (tema escuro)
   ===================================================================== */
:root {
  --bg: #060912;
  --bg-2: #0a0f1c;
  --surface: rgba(20, 27, 45, 0.72);
  --surface-solid: #111827;
  --surface-2: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2f8;
  --text-2: #b8c2d6;
  --muted: #8591a8;
  --a1: #7c9cff;
  --a2: #a78bfa;
  --a3: #5eead4;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 55%, var(--a3));
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  /* paleta categórica validada (fundo escuro) — cores das empresas e séries */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-single: #9085e9;
  --grid: rgba(255, 255, 255, 0.07);
  --radius: 18px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sora", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow: hidden; font-size: 14px;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(124, 156, 255, 0.16), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, rgba(167, 139, 250, 0.12), transparent 60%),
    radial-gradient(700px 500px at 60% 120%, rgba(94, 234, 212, 0.08), transparent 60%);
}
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[data-icon] { display: inline-flex; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.app { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

/* ============================== TOPO ============================== */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 18, 0.6); backdrop-filter: blur(16px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #dbe4ff, var(--a1) 40%, var(--a2) 72%, var(--a3));
  box-shadow: 0 0 24px rgba(124, 156, 255, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.35);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text strong { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text strong em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }
.brand-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.seg {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 10px; border: 0; background: none;
  color: var(--muted); cursor: pointer; font-weight: 500; transition: color .2s, background .2s;
}
.seg:hover { color: var(--text); }
.seg.active { color: var(--text); background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px var(--line-strong); }

.top-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-pill[data-state="connecting"] .dot, .status-pill[data-state="processing"] .dot { background: var(--warn); animation: blink .9s infinite; }
.status-pill[data-state="listening"] .dot { background: var(--a3); box-shadow: 0 0 0 4px rgba(94, 234, 212, .18); }
.status-pill[data-state="speaking"] .dot { background: var(--a2); animation: pulse 1s infinite; }
.status-pill[data-state="error"] .dot { background: var(--err); }
@keyframes blink { 50% { opacity: .3; } }
@keyframes pulse { 50% { transform: scale(1.6); } }

/* ============================== BOTÕES ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; font-weight: 600; text-decoration: none;
  transition: transform .12s, border-color .2s, background .2s, box-shadow .2s; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, .28); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { border-color: transparent; color: #0b0f1c; background: var(--grad); box-shadow: 0 10px 30px rgba(124, 156, 255, .35); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 14px 40px rgba(124, 156, 255, .5); }
.btn.glass { background: rgba(255, 255, 255, .06); backdrop-filter: blur(10px); }
.btn.lg { padding: 14px 22px; font-size: 15px; border-radius: 14px; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; cursor: pointer; flex: none;
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color .2s, background .2s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(255, 255, 255, .07); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.round { border-radius: 50%; width: 44px; height: 44px; }
.icon-btn.on { color: var(--err); border-color: rgba(248, 113, 113, .5); }
.link-btn { background: none; border: 0; color: var(--a1); cursor: pointer; font-size: 12.5px; padding: 0; }

/* ============================== VIEWS ============================== */
.views { flex: 1; min-height: 0; position: relative; }
.view { display: none; height: 100%; min-height: 0; }
.app[data-view="live"] .view-live { display: grid; }
.app[data-view="dash"] .view-dash { display: block; overflow: auto; }
.app[data-view="console"] .view-console { display: block; overflow: auto; }
.app[data-view="look"] .view-look { display: block; overflow: auto; }
.app[data-view="gestor"] .view-gestor { display: block; overflow: auto; }

/* ============================ ATENDIMENTO ============================ */
.view-live { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; padding: 18px; transition: grid-template-columns .5s ease; }
.app:not(.running):not(.demo-running) .view-live { grid-template-columns: minmax(0, 1fr) 0; gap: 0; }
.app:not(.running):not(.demo-running) .rail { opacity: 0; pointer-events: none; overflow: hidden; }
.rail { transition: opacity .4s; }

.stage {
  position: relative; min-height: 0; border-radius: 26px; overflow: hidden; isolation: isolate; container-type: size;
  background: #070b16; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stage-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.stage-bg i {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; filter: blur(90px); opacity: .35;
  animation: drift 22s ease-in-out infinite alternate;
}
.stage-bg i:nth-child(1) { background: #3246a8; left: -15%; top: -25%; }
.stage-bg i:nth-child(2) { background: #5b3aa8; right: -20%; top: 10%; animation-duration: 28s; }
.stage-bg i:nth-child(3) { background: #0f766e; left: 20%; bottom: -45%; animation-duration: 32s; opacity: .25; }
@keyframes drift { to { transform: translate(8%, 6%) scale(1.12); } }
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 75%);
}

#avatarVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s; background: #000; }
.stage.video-on #avatarVideo { opacity: 1; }
.stage.video-on .persona, .stage.video-on .persona-halo { opacity: 0; }

/* ---------- pessoa virtual (avatar ilustrado) ---------- */
.persona {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 1;
  height: min(94cqh, 118cqw); aspect-ratio: 400 / 460; transition: opacity .45s ease, transform .45s ease, filter .45s ease, height .7s cubic-bezier(.2, .8, .2, 1);
}
.app:not(.running):not(.demo-running) .persona { height: min(70cqh, 100cqw); }
.persona-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .45)); }
.persona.swap-out { opacity: 0; transform: translateX(-50%) translateY(18px) scale(.97); filter: blur(6px); }
.persona-halo {
  position: absolute; left: 50%; bottom: 20cqh; width: min(70cqh, 90cqw); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; z-index: 0; pointer-events: none; transition: opacity .6s, background .8s;
  background: radial-gradient(circle, color-mix(in srgb, var(--persona-accent, var(--a1)) 38%, transparent) 0%, transparent 62%);
}

.hud { position: absolute; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 3; pointer-events: none; }
.hud-top { top: 18px; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.hud-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: rgba(6, 9, 18, .55); border: 1px solid var(--line); backdrop-filter: blur(10px); pointer-events: auto;
}
.hud-chip .ic { width: 15px; height: 15px; color: var(--a3); }
.agent-chip b { font-weight: 600; }
.agent-chip .agent-org { color: var(--muted); }
.agent-chip { transition: border-color .4s; border-color: color-mix(in srgb, var(--persona-accent, var(--a1)) 45%, transparent); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.app.running .live-dot, .app.demo-running .live-dot { background: var(--err); box-shadow: 0 0 0 4px rgba(248, 113, 113, .2); animation: blink 1.4s infinite; }
@keyframes pop { 40% { transform: scale(1.25); } }

/* ---------- bandeiras (somente indicação visual) ---------- */
.flags { display: flex; gap: 6px; padding: 6px 9px; border-radius: 999px; background: rgba(6, 9, 18, .4); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.flag {
  position: relative; width: 20px; height: 15px; border-radius: 3px; background-size: cover; background-position: center;
  opacity: .45; filter: saturate(.7); transition: opacity .3s, transform .3s, filter .3s, box-shadow .3s;
  font-size: 9px; font-weight: 600; color: var(--text-2); display: grid; place-items: center; overflow: hidden;
}
.flag.fi { line-height: 15px; }
button.flag { border: 0; padding: 0; cursor: pointer; }
button.flag:hover, button.flag:focus-visible { opacity: 1; filter: none; transform: scale(1.12); outline: none; }

/* seletor de idioma da tela inicial: toque na bandeira para começar a conversa nesse idioma */
.lang-pick { pointer-events: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: min(760px, 92vw); margin-top: 14px; }
.lang-pick[hidden] { display: none; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(6, 9, 18, .45); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  backdrop-filter: blur(8px); transition: transform .2s, border-color .2s, background .2s;
}
.lang-btn:hover, .lang-btn:focus-visible { transform: translateY(-2px); border-color: rgba(255, 255, 255, .5); background: rgba(6, 9, 18, .7); outline: none; }
.lang-flag { width: 22px; height: 16px; border-radius: 3px; background-size: cover; background-position: center; flex: none; }
@media (max-width: 640px) { .lang-btn { padding: 7px 10px; font-size: 13px; } .lang-pick { gap: 6px; } }
.flag.active { opacity: 1; filter: none; transform: scale(1.18); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); animation: pop .5s ease; }

/* ---------- tela inicial mínima ---------- */
.welcome {
  position: absolute; left: 0; right: 0; top: 11cqh; z-index: 4; display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 0 24px; gap: 10px; pointer-events: none; transition: opacity .5s, visibility .5s, transform .5s;
}
.app.running .welcome, .app.demo-running .welcome { opacity: 0; visibility: hidden; transform: translateY(-12px); }
.welcome h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.4vw, 58px); letter-spacing: -.03em; line-height: 1.05; text-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome-sub { margin: 0; color: var(--text-2); font-size: clamp(17px, 1.8vw, 24px); font-weight: 500; min-height: 1.4em; transition: opacity .45s, transform .45s; }
.welcome-sub.fade { opacity: 0; transform: translateY(6px); }

/* ---------- transferência ---------- */
.handoff { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; background: rgba(6, 9, 18, .55); backdrop-filter: blur(6px); animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.handoff-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 40px; text-align: center; }
.handoff-card small { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.handoff-card strong { font-family: var(--display); font-size: clamp(24px, 3vw, 34px); font-weight: 600; }
.handoff-card span:last-child { color: var(--text-2); }
.handoff-ring { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 10px; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--persona-accent, var(--a1)); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.session-actions { position: absolute; top: 64px; left: 18px; z-index: 5; display: flex; gap: 8px; }

.captions {
  position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 3;
  width: min(820px, calc(100% - 40px)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.caption {
  max-width: 100%; padding: 10px 18px; border-radius: 14px; background: rgba(6, 9, 18, .72); backdrop-filter: blur(10px);
  border: 1px solid var(--line); font-size: clamp(15px, 1.35vw, 19px); line-height: 1.45; text-align: center; animation: rise .3s ease;
}
.caption small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.caption.user { font-size: 14px; color: #cfe8ff; }
.app.no-captions .captions { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.action-cards { position: absolute; top: 64px; right: 18px; z-index: 5; width: min(330px, calc(100% - 36px)); display: flex; flex-direction: column; gap: 10px; max-height: calc(100% - 200px); overflow: auto; scrollbar-width: none; }
.action-card {
  background: rgba(13, 18, 32, .9); border: 1px solid var(--line-strong); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px); animation: slideIn .35s cubic-bezier(.2, .8, .2, 1); font-size: 13px;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.action-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ac-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(52, 211, 153, .14); color: var(--ok); }
.action-card.err .ac-icon { background: rgba(248, 113, 113, .14); color: var(--err); }
.ac-title { font-weight: 600; flex: 1; }
.ac-close { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.ac-media { width: 100%; height: 140px; border-radius: 12px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); }
.ac-preview-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ac-media:hover .ac-preview-img { transform: scale(1.05); }
.qr { display: flex; justify-content: center; margin: 12px 0 4px; }
.qr img, .qr canvas { background: #fff; padding: 8px; border-radius: 12px; width: 150px !important; height: 150px !important; }
.code { display: flex; gap: 6px; margin-top: 10px; }
.code input { flex: 1; min-width: 0; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-family: ui-monospace, monospace; font-size: 11.5px; }
.action-card .btn { margin-top: 10px; }

.toast {
  position: absolute; left: 50%; top: 66px; transform: translateX(-50%); z-index: 6; width: max-content; max-width: min(560px, calc(100% - 36px));
  padding: 10px 16px; border-radius: 12px; font-size: 13px; text-align: center; backdrop-filter: blur(10px);
  background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .4); color: #fde68a;
}
.toast.error { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .45); color: #fecaca; }

.dock {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 6;
  width: min(760px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 22px; background: rgba(8, 12, 24, .72); border: 1px solid var(--line-strong); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.mic-btn {
  position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; flex: none; color: #0b0f1c;
  background: var(--grad); box-shadow: 0 10px 30px rgba(124, 156, 255, .45); display: grid; place-items: center;
}
.mic-btn .ic { width: 22px; height: 22px; }
.mic-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(124, 156, 255, .4); transform: scale(calc(1 + var(--mic, 0) * .35)); transition: transform .08s linear; }
.mic-ic-off { display: none !important; }
.app.running .mic-btn, .app.demo-running .mic-btn { background: #2a1119; color: #fecaca; box-shadow: 0 0 0 1px rgba(248, 113, 113, .5); }
.app.running .mic-ic-on, .app.demo-running .mic-ic-on { display: none !important; }
.app.running .mic-ic-off, .app.demo-running .mic-ic-off { display: inline-flex !important; }
.composer { flex: 1; min-width: 0; display: flex; gap: 8px; }
.mic-hint { color: var(--text-2); font-weight: 500; padding-right: 10px; white-space: nowrap; }
.app.running .mic-hint, .app.demo-running .mic-hint { display: none; }
.app:not(.running) .live-only { display: none; }
.app:not(.running):not(.demo-running) .dock { width: auto; padding: 8px 10px 8px 8px; }
.composer input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 14px; background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line); outline: none;
}
.composer input:focus { border-color: rgba(124, 156, 255, .6); }
#btnSound.off { color: var(--muted); }

/* --------------------------- trilho lateral --------------------------- */
.rail { display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.rail-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(12px); }
.rail-block.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.block-head h3, .card h3 { margin: 0; font-family: var(--display); font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }

.company-list { display: flex; flex-direction: column; gap: 8px; }
.company {
  --c: var(--a1);
  position: relative; display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s;
}
.company:hover { border-color: var(--line-strong); }
.company .logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; background: var(--c); box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 45%, transparent); }
.company .logo .ic { width: 19px; height: 19px; }
.company .meta { min-width: 0; }
.company .meta strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company .meta span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company .floor { font-size: 11.5px; color: var(--muted); }
.company.active { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.company.active::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--c); }

.timeline { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.timeline .empty { color: var(--muted); font-size: 13px; padding: 12px 0; }
.tl { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; animation: rise .3s ease; position: relative; }
.tl::before { content: ""; position: absolute; left: 13.5px; top: 36px; bottom: -4px; width: 1px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .dot { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--text-2); }
.tl .dot .ic { width: 15px; height: 15px; }
.tl.tool .dot { background: rgba(124, 156, 255, .14); color: var(--a1); }
.tl.ok .dot { background: rgba(52, 211, 153, .14); color: var(--ok); }
.tl.err .dot { background: rgba(248, 113, 113, .14); color: var(--err); }
.tl .body { min-width: 0; font-size: 13px; line-height: 1.45; }
.tl .body b { font-weight: 600; }
.tl .body .sub { color: var(--muted); font-size: 12px; }
.tl .time { color: var(--muted); font-size: 11px; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ============================ PAINEL ============================ */
.dash-wrap, .console-wrap { max-width: 1320px; margin: 0 auto; padding: 26px 22px 40px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h2 { margin: 0 0 4px; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.dash-head p { margin: 0; }
.dash-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge.demo { background: rgba(167, 139, 250, .14); color: #d8ccff; border: 1px solid rgba(167, 139, 250, .35); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--grad); opacity: .55; }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .label .ic { width: 15px; height: 15px; color: var(--text-2); }
.kpi .value { white-space: nowrap; font-family: var(--display); font-size: clamp(22px, 2.1vw, 30px); font-weight: 600; letter-spacing: -.02em; margin-top: 10px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .value.small { font-size: 18px; white-space: normal; }
.kpi .hint { margin-top: 6px; color: var(--muted); font-size: 12px; }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(12px); min-width: 0; }
.card.span-2 { grid-column: span 2; }
.card > header { margin-bottom: 14px; }
.card > header p, .row-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.chart { position: relative; width: 100%; min-height: 200px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text, .chart .lbl { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .val { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.chart .name { fill: var(--text); font-size: 12.5px; font-family: var(--font); }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar { transition: opacity .15s; }
.chart .dimmed .bar { opacity: .45; }
.chart .dimmed .bar.hover { opacity: 1; }
.chart-empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); font-size: 13px; text-align: center; }

.chart-tip {
  position: fixed; z-index: 50; pointer-events: none; padding: 8px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.4;
  background: #0d1322; border: 1px solid var(--line-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); white-space: nowrap;
}
.chart-tip b { font-weight: 600; }
.chart-tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 10px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .co { display: inline-flex; align-items: center; gap: 8px; }
.table .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.inline-bar { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .06); min-width: 80px; }
.inline-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.pill .ic { width: 12px; height: 12px; }
.pill.ok { background: rgba(52, 211, 153, .12); color: #86efac; }
.pill.warn { background: rgba(251, 191, 36, .12); color: #fde68a; }
.pill.err { background: rgba(248, 113, 113, .12); color: #fecaca; }
.pill.neutral { background: rgba(255, 255, 255, .06); color: var(--text-2); }
.empty-row { color: var(--muted); text-align: center; padding: 26px 0 !important; }
.table-scroll { overflow-x: auto; }

/* ============================ CONSOLE ============================ */
.console-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); }
.field select, .field textarea, .field input { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--text); outline: none; }
.field textarea { font-family: ui-monospace, monospace; font-size: 12.5px; resize: vertical; }
.field select:focus, .field textarea:focus, .field input:focus { border-color: rgba(124, 156, 255, .6); }
.code-out, .log-item pre {
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 12px 0 0;
  font-size: 11.5px; overflow: auto; max-height: 300px; white-space: pre-wrap; word-break: break-word;
}
.log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow: auto; }
.log-list .empty { color: var(--muted); text-align: center; padding: 20px 0; }
.log-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(255, 255, 255, .02); }
.log-item .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.log-item .tool { font-family: ui-monospace, monospace; font-size: 12.5px; }
.log-item .meta { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.log-item .msg { margin-top: 6px; line-height: 1.45; font-size: 13px; }
.log-item summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 6px; }
.diag { font-size: 13px; line-height: 1.9; margin-bottom: 14px; }
.diag .row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin-bottom: 14px; cursor: pointer; }
.toggle input { margin-top: 3px; accent-color: var(--a1); }
.toggle small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-row a { font-size: 12.5px; color: var(--text-2); text-decoration: none; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; }
.link-row a:hover { border-color: var(--line-strong); color: var(--text); }
.transcript { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow: auto; }
.transcript .empty { color: var(--muted); text-align: center; }
.bubble { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.bubble.agent { background: rgba(255, 255, 255, .06); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.user { background: rgba(124, 156, 255, .18); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.system { align-self: center; background: none; color: var(--muted); font-size: 12px; padding: 2px; }

/* ======================== MODO APRESENTAÇÃO ======================== */
.app.presenting .topbar, .app.presenting .rail { display: none; }
.app.presenting .view-live { grid-template-columns: 1fr; padding: 0; }
.app.presenting .stage { border-radius: 0; border: 0; }
.app.presenting #btnExitPresent { display: inline-flex; }

.stage:fullscreen { border-radius: 0; border: 0; }

/* ============================ RESPONSIVO ============================ */
@media (max-width: 1100px) {
  .view-live, .app:not(.running):not(.demo-running) .view-live { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: auto; gap: 18px; }
  .app:not(.running):not(.demo-running) .rail { display: none; }
  .stage { height: max(600px, 74vh); }
  .rail { display: grid; grid-template-columns: 1fr 1fr; }
  .rail-block.grow { max-height: 360px; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.span-2 { grid-column: span 2; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .topbar { grid-template-columns: 1fr auto; padding: 10px 16px; row-gap: 10px; }
  .segmented { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .seg { flex: 1; justify-content: center; padding: 8px 6px; }
  .brand-text strong em, #statusText, #btnFullscreen { display: none; }
  .view-live { padding: 12px 16px; gap: 12px; }
  .stage { border-radius: 20px; }
  .rail { grid-template-columns: 1fr; }
  .dash-grid, .console-wrap { grid-template-columns: 1fr; }
  .card.span-2 { grid-column: auto; }
  .dash-wrap, .console-wrap { padding: 18px 16px 32px; }
  .welcome { top: 76px; }
  .welcome h1 { font-size: 30px; }
  .stage { height: 700px; }
  .flags { max-width: 46vw; overflow: hidden; }
  .agent-chip .agent-org { display: none; }
  .app:not(.running):not(.demo-running) .hud-top { display: none; }
  .persona { height: min(80cqh, 118cqw); }
  #btnDemo span:last-child { display: none; }
  .dock { gap: 8px; padding: 8px; bottom: 12px; width: calc(100% - 24px); }
  .mic-btn { width: 48px; height: 48px; }
  .icon-btn.round { width: 40px; height: 40px; }
  .action-cards { top: 76px; bottom: auto; right: 12px; left: 12px; width: auto; max-height: 50%; }
  .captions { bottom: 96px; }
  .hud { left: 12px; right: 12px; }
  .hud-top { top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- vendas ---- */
.dash-head.dash-sub { margin-top: 30px; }
.ac-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.table .btn.xs { padding: 4px 10px; font-size: 11.5px; border-radius: 8px; }
.msg-sub { color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan { display: inline-flex; align-items: center; gap: 6px; }
.chan .ic { width: 14px; height: 14px; color: var(--text-2); }
#tableOrders .table td.mono, #tableOrders .table .num, #tableOutbox .table td.mono { white-space: nowrap; }
.kv.money { grid-template-columns: 1fr auto; }
.kv.money dd { white-space: nowrap; overflow-wrap: normal; }

/* ---- modo público (quiosque) × administrador ---- */
.app:not(.is-admin) .admin-only { display: none !important; }
.app:not(.is-admin) .view-live,
.app:not(.is-admin).running .view-live { grid-template-columns: minmax(0, 1fr) !important; gap: 0; }
.app:not(.is-admin) .topbar { justify-content: space-between; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(4, 7, 14, .72); backdrop-filter: blur(8px); }
.modal[hidden] { display: none; }
.modal-card { width: min(420px, 100%); background: var(--surface-2, #111827); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 30px 80px #000a; }
.modal-card h3 { margin: 0 0 6px; font-family: var(--display); }
.modal-card p { font-size: 13px; margin: 0 0 14px; }
.modal-card input { width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: inherit; font: inherit; }
.modal-err { color: #fecaca; margin-top: 8px !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
/* ---- banco de dados ---- */
.db-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.db-filters .field { margin: 0; min-width: 160px; }
.db-filters .field.grow { flex: 1; min-width: 200px; }
.db-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; font-size: 12.5px; }
.db-detail { font-family: var(--mono, monospace); font-size: 11.5px; white-space: pre-wrap; max-height: 260px; overflow: auto; background: rgba(255,255,255,.03); border-radius: 8px; padding: 10px; margin: 6px 0 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: rgba(255,255,255,.025); }

/* ---- avatar com foto ---- */
.persona-photo { --speak: 0; position: relative; width: 100%; height: 100%; display: grid; place-items: end center; }
.persona-photo img {
  height: 94%; max-width: 92%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center top;
  border-radius: 28px 28px 0 0; transform-origin: 50% 100%; transition: filter .3s;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--persona-accent, #7c9cff) 70%, transparent),
              0 0 calc(24px + var(--speak) * 60px) calc(var(--speak) * 10px) color-mix(in srgb, var(--persona-accent, #7c9cff) 45%, transparent),
              0 30px 60px rgba(0, 0, 0, .45);
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%); mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}
.persona-photo[data-state="processing"] img { filter: saturate(.9) brightness(.96); }

/* ---- aparência e voz ---- */
.look-alert { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); color: #fecaca; border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 0 0 16px; }
.small { font-size: 12.5px; }
.voice-lab { margin-bottom: 18px; }
.lab-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.lab-tab { border: 1px solid var(--line); background: transparent; color: var(--text-2); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.lab-tab.active { background: rgba(124, 156, 255, .14); color: var(--text); border-color: rgba(124, 156, 255, .5); }
.lab-pane { display: flex; flex-direction: column; gap: 12px; }
.lab-pane[hidden] { display: none; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.file-btn { cursor: pointer; }
.lab-status { margin: 0; font-size: 13px; color: var(--text-2); min-height: 1em; }
.lab-status.err { color: #fecaca; }
.lab-status.ok { color: #86efac; }
.btn.recording { background: rgba(248, 113, 113, .18); border-color: rgba(248, 113, 113, .5); }
.design-previews { display: grid; gap: 10px; }
.design-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.design-preview audio { height: 36px; max-width: 100%; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.look-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
.look-preview { position: relative; height: 200px; border-radius: 14px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, rgba(124,156,255,.18), rgba(0,0,0,.25)); border: 1px solid var(--line); }
.look-preview .persona-svg { width: 100%; height: 100%; }
.look-preview .persona-photo img { height: 100%; max-width: 100%; border-radius: 0; }
.look-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.look-fields .field { margin: 0; }
.look-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.voice-row { display: flex; gap: 8px; align-items: flex-end; }
.voice-row .field { flex: 1; min-width: 0; }
.colors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.colors label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }
.colors input[type=color] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }
.look-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.look-card h3 { margin: 0; }
.look-card .muted { font-size: 12px; }
@media (max-width: 560px) {
  .look-card { grid-template-columns: 1fr; }
  .look-preview { height: 220px; max-width: 200px; }
  .look-row { grid-template-columns: 1fr; }
}
.colors select { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; color: var(--text); font: inherit; font-size: 12.5px; }
@media (max-width: 720px) {
  .app.is-admin .segmented { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .app.is-admin .segmented .seg { flex: none; }
  .app.is-admin .top-actions { flex-wrap: wrap; justify-content: flex-end; }
}

/* galeria de visuais prontos */
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.gallery-head select { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; color: var(--text); font: inherit; font-size: 12.5px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text-2); font: inherit; font-size: 11px; cursor: pointer; }
.preset:hover { border-color: rgba(124, 156, 255, .45); }
.preset.active { border-color: rgba(124, 156, 255, .9); background: rgba(124, 156, 255, .12); color: var(--text); }
.preset-thumb { width: 54px; height: 62px; border-radius: 8px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, rgba(124,156,255,.18), rgba(0,0,0,.2)); }
.preset-thumb .persona-svg { width: 100%; height: 100%; filter: none; }
.colors label.chk { flex-direction: row; align-items: center; gap: 6px; }

/* biblioteca de vozes */
.library-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.library-list { overflow-x: hidden; }
.library-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.lib-info { display: flex; flex-direction: column; min-width: 0; }
.lib-info > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-item .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .library-item { grid-template-columns: auto minmax(0, 1fr); }
  .library-item .btn { grid-column: 1 / -1; justify-self: start; }
}
#libraryPane .lab-row .field { margin: 0; }
#libraryPane .lab-row .field.grow { flex: 1; min-width: 180px; }

/* ============ Resultados, privacidade e acesso por empresa ============ */
.app:not(.is-panel) .panel-only { display: none !important; }
.app:not(.is-company) .company-only { display: none !important; }
.app[data-view="results"] .view-results,
.app[data-view="trust"] .view-trust { display: block; overflow: auto; }
.app.is-company .topbar .segmented .seg.admin-only { display: none !important; }
.role-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.card.span-3 { grid-column: 1 / -1; }
.kpis.hero .kpi { background: linear-gradient(160deg, rgba(124,156,255,.14), rgba(167,139,250,.06) 60%, var(--surface)); border-color: rgba(124,156,255,.22); }
.kpis.hero .kpi .value { font-size: clamp(24px, 2.4vw, 34px); }
.sel-sm { height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.sel-sm option { background: var(--surface-solid); }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang-toggle button { border: 0; background: transparent; color: var(--muted); padding: 7px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.lang-toggle button.active { background: var(--surface-2); color: var(--text); }
.table td.wrap { white-space: normal; min-width: 180px; line-height: 1.45; }
.feedback-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feedback-list p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.stars { letter-spacing: 1px; color: var(--warn); }
.stars.s1, .stars.s2 { color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
.btn.danger { border-color: rgba(248,113,113,.35); color: #fecaca; background: rgba(248,113,113,.08); }
.btn.danger:hover:not(:disabled) { background: rgba(248,113,113,.16); }
.ok-note { color: #86efac; }
.policy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.policy-list li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.policy-list .ic { width: 16px; height: 16px; flex: none; color: var(--a1); }
.policy-list a { color: var(--a1); }
.key-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.key-box input { flex: 1 1 220px; min-width: 0; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.key-box small { flex-basis: 100%; }
.modal-card.wide { width: min(640px, 100%); }
.report-pre { white-space: pre-wrap; font-family: var(--font); font-size: 13.5px; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 50vh; overflow: auto; }
/* aviso de privacidade no quiosque */
.consent { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); margin: 0; font-size: 11px; color: var(--muted); white-space: nowrap; z-index: 3; opacity: .8; }
.consent a { color: var(--text-2); margin-left: 4px; }
.app.presenting .consent { opacity: .6; }
@media (max-width: 640px) {
  .consent { white-space: normal; text-align: center; width: calc(100% - 32px); }
  .dash-actions { flex-wrap: wrap; }
}
.kpis.hero .kpi .value.small { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.25; }
@media (min-width: 1100px) { #resKpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#dsrForm { align-items: flex-end; }
#dsrForm .field { flex: 1 1 260px; margin: 0; }
#dsrForm input { width: 100%; }
.app.is-panel .segmented .seg span:last-child { white-space: nowrap; }
@media (max-width: 1500px) {
  .app.is-admin .brand-text { display: none; }
}
.role-chip { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.app.is-company .view-dash .dash-head:first-child .dash-actions { display: none; }
.app.is-company .view-dash .dash-head.dash-sub:first-of-type { margin-top: 0; }
.app.is-company #statusPill { display: none; }
/* código da porta no cartão do check-in (quiosque do hotel) */
.key-code { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px 0; padding: 12px; border-radius: 14px; background: rgba(124,156,255,.12); border: 1px solid rgba(124,156,255,.3); }
.key-code small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.key-code strong { font-family: var(--display); font-size: 34px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }

/* =====================================================================
   AVATARES DO UNIVERSO (UI DINÂMICA PREMIUM)
   ===================================================================== */
#stage[data-theme="vortex"] .persona,
#stage[data-theme="hyperspace"] .persona,
#stage[data-theme="galaxy"] .persona {
  display: none !important;
}

/* Centralizando e aumentando a escala do container principal */
#stage[data-theme="vortex"] .persona-halo,
#stage[data-theme="hyperspace"] .persona-halo,
#stage[data-theme="galaxy"] .persona-halo {
  opacity: 1 !important;
  background: none;
  filter: none;
  bottom: 45% !important; /* Move para o centro da tela */
  transform: translateX(-50%) translateY(50%) !important;
  width: 500px !important;
  height: 500px !important;
}

/* Base keyframes psicodélicos */
@keyframes cosmic-pulse { 0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.8; filter: hue-rotate(0deg); } 100% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; filter: hue-rotate(45deg); } }
@keyframes cosmic-spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes cosmic-spin-rev { 0% { transform: translate(-50%, -50%) rotate(360deg); } 100% { transform: translate(-50%, -50%) rotate(0deg); } }
@keyframes cosmic-spin-3d { 0% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(0deg); } 100% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(360deg); } }

/* 1. VÓRTICE CÓSMICO (Neon/Psicodélico) */
#stage[data-theme="vortex"] .persona-halo::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 100px; height: 100px; border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 40px #fff, 0 0 100px #ff00ff, 0 0 200px #00ffff, 0 0 350px #8a2be2;
  animation: cosmic-pulse 1.8s infinite alternate ease-in-out;
  z-index: 5; mix-blend-mode: screen;
}
#stage[data-theme="vortex"] .persona-halo::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 380px; height: 380px; border-radius: 50%;
  border: 6px dashed rgba(255, 0, 255, 0.6);
  animation: cosmic-spin 6s linear infinite;
  box-shadow: inset 0 0 80px rgba(0, 255, 255, 0.4), 0 0 60px rgba(255, 0, 255, 0.3);
  mix-blend-mode: color-dodge;
}

/* 2. NEBULOSA ROXA (Baseado na sua imagem) */
#stage[data-theme="hyperspace"] .persona-halo {
  width: 700px !important;
  height: 700px !important;
}
#stage[data-theme="hyperspace"] .persona-halo::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 10%, #d400ff 40%, transparent 70%);
  box-shadow: 0 0 80px #ffffff, 0 0 150px #aa00ff, 0 0 300px #6600ff;
  animation: cosmic-pulse 2.5s infinite alternate ease-in-out;
  z-index: 5;
  mix-blend-mode: screen;
}
#stage[data-theme="hyperspace"] .persona-halo::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 550px; height: 550px; border-radius: 50%;
  /* O anel pontilhado de diamantes */
  border: 8px dotted rgba(255, 200, 255, 0.9);
  /* O fundo espiral roxo */
  background: conic-gradient(from 0deg, rgba(170, 0, 255, 0.1) 0%, rgba(200, 50, 255, 0.6) 25%, rgba(100, 0, 255, 0.2) 50%, rgba(200, 50, 255, 0.6) 75%, rgba(170, 0, 255, 0.1) 100%);
  box-shadow: inset 0 0 100px rgba(170,0,255,0.5), 0 0 60px rgba(170,0,255,0.4);
  filter: drop-shadow(0 0 20px #aa00ff);
  animation: cosmic-spin 8s linear infinite;
  mix-blend-mode: hard-light;
}

/* 3. GALÁXIA ESPIRAL (3D Imersiva) */
#stage[data-theme="galaxy"] .persona-halo::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 90px; height: 90px; border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 50px #ffbb88, 0 0 120px #ff5500, 0 0 250px #ff0055;
  z-index: 2;
  animation: cosmic-pulse 2.2s infinite alternate ease-in-out;
}
#stage[data-theme="galaxy"] .persona-halo::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 450px; height: 450px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(200, 50, 255, 0.9) 25%, transparent 50%, rgba(50, 150, 255, 0.9) 75%, transparent 100%);
  filter: blur(12px);
  animation: cosmic-spin-3d 5s linear infinite;
  mix-blend-mode: hard-light;
}

/* ---------- painel do gestor ---------- */
.billing-banner { display: flex; align-items: center; gap: 12px; margin: 0 16px 10px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.billing-banner[hidden], .app:not(.is-panel) .billing-banner, .app[data-view="live"] .billing-banner { display: none; }
.billing-banner.warn { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .35); color: #fde68a; }
.billing-banner.err { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .45); color: #fecaca; animation: bbPulse 2.4s ease-in-out infinite; }
.billing-banner > div { flex: 1; min-width: 0; }
.billing-banner .bb-ic .ic, .g-alert-ic .ic { width: 18px; height: 18px; }
@keyframes bbPulse { 50% { box-shadow: 0 0 0 4px rgba(248, 113, 113, .12); } }
.g-alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.g-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
.g-alert small { display: block; color: var(--muted); margin-top: 3px; }
.g-alert.err { border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); }
.g-alert.warn { border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .07); }
.g-alert.ok { border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .06); }
.g-alert.err .g-alert-ic { color: var(--err); } .g-alert.warn .g-alert-ic { color: var(--warn); } .g-alert.ok .g-alert-ic { color: var(--ok); }
.g-meter { height: 5px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 4px; min-width: 80px; }
.g-meter i { display: block; height: 100%; border-radius: inherit; background: #9085e9; }
.g-meter.warn i { background: var(--warn); } .g-meter.err i { background: var(--err); }
.g-usage { display: grid; gap: 6px; min-width: 200px; font-size: 12px; }
.g-reason { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; max-width: 260px; white-space: normal; }
.g-row-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-end; }
.g-chips { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.g-chips button { background: none; border: 0; color: var(--text-2); font: inherit; font-size: 12.5px; padding: 7px 11px; cursor: pointer; }
.g-chips button.active { background: rgba(255,255,255,.1); color: var(--text); }
.g-healths { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.g-health { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); font-size: 12.5px; }
.g-health .pill { align-self: flex-start; }
.gestor-modal { max-height: 88vh; overflow: auto; }
.g-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.g-form .field input, .g-form .field select { width: 100%; box-sizing: border-box; }
.g-check { display: flex; gap: 10px; align-items: center; font-size: 13px; margin: 6px 0; cursor: pointer; }
.g-check input { width: 16px; height: 16px; accent-color: #9085e9; }
.g-h4 { margin: 14px 0 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.g-steps { display: grid; gap: 6px; }
.g-step small { display: block; color: var(--muted); margin-top: 3px; font-size: 11.5px; word-break: break-word; }
.g-ok { color: #86efac; font-size: 13px; } .g-hint { font-size: 12.5px; color: #fde68a; background: rgba(251,191,36,.08); padding: 10px; border-radius: 10px; }
@media (max-width: 640px) { .g-form { grid-template-columns: 1fr; } .billing-banner { margin: 0 10px 8px; flex-wrap: wrap; } }
.app[data-view="gestor"] .billing-banner { display: none; }
.view-gestor .kpis.hero .kpi .value.small { font-size: clamp(18px, 1.55vw, 24px); }
@media (max-width: 1560px) {
  .app.is-admin #btnDemo span:last-child, .app.is-admin #btnLogout span:last-child { display: none; }
}
.lang-flag.no-img { display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--text-2); background: rgba(255,255,255,.08); }

/* ── Cards de hotel: imagens e código de porta ─────────────────── */
.ac-media {
  width: 100%; border-radius: 10px; overflow: hidden;
  margin-bottom: 10px; background: rgba(255,255,255,.04);
  max-height: 160px; display: flex; align-items: center; justify-content: center;
}
.ac-media-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px; margin-bottom: 10px;
}
.ac-media-row .ac-media { margin-bottom: 0; max-height: 100px; border-radius: 8px; }
.ac-preview-img {
  width: 100%; height: 100%; object-fit: cover;
  min-height: 100px; max-height: 160px; display: block;
  opacity: 0; transition: opacity .4s ease;
}
/* Imagem visível: classe .loaded (adicionada após load/error) OU data-URI (carrega síncronamente) */
.ac-preview-img.loaded { opacity: 1; animation: imgFadeIn .4s ease forwards; }
/* Garante que imagens com src (fallback para cache) apareçam */
.ac-preview-img[src^="data:"] { opacity: 1; }
@keyframes imgFadeIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: scale(1); } }

/* Código da porta — "somente tela" */
.key-code {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 10px; padding: 10px 14px; margin: 8px 0; text-align: center;
}
.key-code small {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  color: #fbbf24; text-transform: uppercase;
}
.key-code strong {
  font-size: 28px; font-weight: 700; letter-spacing: .22em;
  font-variant-numeric: tabular-nums; color: var(--text);
}

/* Cartões individuais de quartos e fotos de pratos */
.room-card-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  transition: transform .2s ease, border-color .2s ease;
}
.room-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.room-card-media {
  width: 100%;
  height: 110px;
  position: relative;
  overflow: hidden;
  background: #182030;
}
.room-card-media .ac-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.room-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
.room-card-content {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.room-card-info h4 {
  margin: 0 0 2px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.room-card-info .room-card-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.room-card-price {
  text-align: right;
}
.room-card-price .price-rate {
  font-size: 15px;
  font-weight: 700;
  color: var(--ok);
}
.room-card-price .price-total {
  font-size: 11px;
  color: var(--muted);
}
.dish-card-media {
  width: 100%;
  height: 140px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #182030;
  margin-bottom: 10px;
}
.dish-card-media .ac-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dish-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
