/* Design system luxxen.ai: Midnight / Violet / Electric Blue, Plus Jakarta Sans. */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url(/fonts/pjs-400.ttf) format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(/fonts/pjs-600.ttf) format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url(/fonts/pjs-700.ttf) format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url(/fonts/pjs-800.ttf) format("truetype"); }

:root {
	color-scheme: dark;
	--surface: #0b0f1a;
	--raised: #11162a;
	--raised-2: #1a2040;
	--border: #232a44;
	--border-strong: #6b7280;
	--ink: #f5f6fa;
	--muted: #a7aec2;
	--violet: #7c3aed;
	--violet-hover: #6d28d9;
	--av: #a78bfa;
	--ab: #60a5fa;
	--focus: #60a5fa;
	/* categorias dos graficos (validadas na superficie --raised) */
	--s-ag: #3987e5;
	--s-ca: #d95926;
	--s-co: #199e70;
	--warn-bg: #2a2410;
	--warn-ink: #f2d98a;
	--ok: #34d399;
}
* { box-sizing: border-box; }
html { background: var(--surface); }
body {
	margin: 0; min-height: 100dvh; color: var(--ink); font: 400 16px/24px "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	background: radial-gradient(900px 420px at 50% -120px, rgba(124, 58, 237, .28), transparent 70%), var(--surface);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--ab); }

/* ---------- casca ---------- */
.topbar { max-width: 1180px; margin: 0 auto; padding: 20px 20px 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar img { height: 28px; width: auto; display: block; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--muted); background: rgba(17, 22, 42, .6); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.shell { max-width: 1180px; margin: 0 auto; padding: 8px 20px 48px; }
.shell.narrow { max-width: 560px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 16px 20px 32px; color: var(--muted); font-size: 13px; }

h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 20px; line-height: 28px; font-weight: 700; }
.sub { color: var(--muted); margin-top: 6px; }
.grad { background: linear-gradient(90deg, var(--av), var(--ab)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.demo-banner { margin: 14px 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; border: 1px solid rgba(242, 217, 138, .25); }

/* ---------- botoes / formularios ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 10px 20px; background: var(--violet); color: #fff; font: 600 14px/20px "Plus Jakarta Sans", sans-serif; cursor: pointer; text-decoration: none; transition: background-color .2s, box-shadow .2s; }
button:hover, .btn:hover { background: var(--violet-hover); box-shadow: 0 0 32px rgba(124, 58, 237, .5); }
button:disabled { opacity: .55; cursor: wait; box-shadow: none; }
button.ghost, .btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--ink); }
button.ghost:hover { border-color: var(--ink); box-shadow: none; background: transparent; }
input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--raised); color: var(--ink); font: inherit; }
input::placeholder { color: var(--muted); }
input:focus { border-color: var(--av); outline: none; box-shadow: 0 0 0 3px rgba(167, 139, 250, .25); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- chat ---------- */
.chatbox { background: var(--raised); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 80px rgba(0, 0, 0, .45); display: flex; flex-direction: column; min-height: 68dvh; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--ab)); display: grid; place-items: center; font-weight: 800; flex: none; }
.chat-head strong { display: block; line-height: 20px; }
.chat-head span { font-size: 13px; color: var(--muted); }
.log { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 16px; font-size: 15px; line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { align-self: flex-start; background: var(--raised-2); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.msg.typing { color: var(--muted); }
.msg.typing::after { content: "…"; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .msg.typing::after { animation: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.chips button { padding: 8px 14px; font-size: 13px; background: transparent; border-color: var(--border); color: var(--muted); }
.chips button:hover { color: var(--ink); border-color: var(--av); background: transparent; box-shadow: none; }
.composer { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); background: rgba(11, 15, 26, .5); }
.chatbox .hint { padding: 0 20px 14px; }

/* ---------- painel ---------- */
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 8px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: rgba(17, 22, 42, .7); width: fit-content; max-width: 100%; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 999px; }
.nav a:hover { color: var(--ink); }
.nav a.on { background: var(--violet); color: #fff; }
.page-head { margin: 18px 0 20px; }
.flash { background: rgba(124, 58, 237, .18); border: 1px solid rgba(167, 139, 250, .4); padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; }
.card { background: var(--raised); border: 1px solid var(--border); border-radius: 20px; padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 4px; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpi { background: var(--raised); border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; }
.kpi .k-label { color: var(--muted); font-size: 13px; }
.kpi .k-value { font-size: 34px; line-height: 40px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.kpi .k-frac { color: var(--muted); font-size: 13px; }
.empty { background: var(--warn-bg); color: var(--warn-ink); padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; border: 1px solid rgba(242, 217, 138, .25); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--raised); margin-bottom: 16px; }
.tabs a { padding: 6px 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a.on { background: var(--raised-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--av); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--raised-2); font-size: 12px; font-weight: 600; }
.tag.agendada { color: #8ab8f2; } .tag.confirmada { color: #5ad1a4; } .tag.cancelada { color: #f09a76; }
.msgcell { max-width: 520px; color: var(--muted); }

/* ---------- graficos ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 0; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart, .hbars { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis, .hbars .lbl, .hbars .val { fill: var(--muted); font: 400 11px "Plus Jakarta Sans", sans-serif; }
.hbars .lbl, .hbars .val { font-size: 13px; }
.hbars .val { fill: var(--ink); font-weight: 700; }
.hbars .track { fill: var(--raised-2); }
.s-ag { fill: var(--s-ag); background: var(--s-ag); } .s-ca { fill: var(--s-ca); background: var(--s-ca); } .s-co { fill: var(--s-co); background: var(--s-co); }
.s-v { fill: var(--av); }
.chart .col .hit { fill: transparent; }
.chart .col:hover .hit { fill: rgba(255, 255, 255, .06); }
.chart rect { stroke: var(--raised); stroke-width: 1; }
.chart .hit, .chart .grid { stroke: none; }
.chart .grid { stroke: var(--border); }
details { margin-top: 10px; color: var(--muted); font-size: 13px; }
summary { cursor: pointer; }

@media (max-width: 720px) {
	.shell { padding: 4px 14px 40px; }
	.msg { max-width: 92%; }
	th, td { padding: 10px 8px; }
}
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
[hidden] { display: none !important; }
.grid > .card { margin-top: 0; }
