:root {
  --bg: #07100e;
  --panel: rgba(13, 25, 22, .82);
  --panel-2: rgba(18, 33, 29, .76);
  --line: rgba(211, 242, 228, .1);
  --text: #eef8f3;
  --muted: #8fa39c;
  --mint: #5be3a8;
  --mint-2: #a3f2ce;
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif; overflow-x: hidden;
}
button, textarea { font: inherit; }
button { color: inherit; }
.login-page { overflow: auto; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { position: relative; width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: rgba(10, 22, 19, .9); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 36px; }
.login-brand strong { display: block; font: 800 16px Manrope, sans-serif; letter-spacing: .12em; }
.login-brand small { color: var(--muted); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.login-card h1 { margin: 0; font: 700 30px Manrope, sans-serif; letter-spacing: -.03em; }
.login-lead { margin: 10px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 6px; color: #91a49d; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.login-form input { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: none; background: rgba(3, 11, 9, .7); color: var(--text); padding: 12px; font: 14px "DM Sans", sans-serif; }
.login-form input:focus { border-color: rgba(91,227,168,.5); box-shadow: 0 0 0 3px rgba(91,227,168,.07); }
.login-form .primary-button { margin-top: 4px; padding: 13px; }
.login-form .primary-button:disabled { opacity: .6; cursor: wait; }
.login-security { margin: 24px 0 0; color: #60736c; text-align: center; font-size: 9px; }
.ambient { position: fixed; border-radius: 50%; filter: blur(120px); pointer-events: none; opacity: .13; }
.ambient-one { width: 500px; height: 500px; background: #4de4a2; left: 28%; top: -300px; }
.ambient-two { width: 450px; height: 450px; background: #377bff; right: -320px; bottom: -250px; }
.shell { display: grid; grid-template-columns: 254px 1fr; min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 20; inset: 0 auto 0 0; width: 254px; padding: 28px 18px 22px;
  display: flex; flex-direction: column; background: rgba(6, 14, 12, .93); border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 30px; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border: 1px solid rgba(91, 227, 168, .48); border-radius: 12px;
  display: grid; place-items: center; color: var(--mint); font-family: Manrope, sans-serif; font-weight: 800;
  background: linear-gradient(145deg, rgba(91, 227, 168, .18), rgba(91, 227, 168, .03)); box-shadow: inset 0 0 20px rgba(91, 227, 168, .08);
}
.brand strong { display: block; font: 800 16px Manrope, sans-serif; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
nav { display: grid; gap: 5px; }
.nav-item { border: 0; background: transparent; border-radius: 10px; padding: 11px 12px; text-align: left; color: var(--muted); cursor: pointer; }
.nav-item span { width: 26px; display: inline-block; }
.nav-item em { float: right; font-size: 9px; font-style: normal; color: #61736d; padding-top: 4px; text-transform: uppercase; }
.nav-item.active { color: var(--text); background: rgba(91, 227, 168, .09); }
.side-section { margin-top: 28px; min-height: 0; overflow: auto; }
.eyebrow { margin: 0 0 10px; font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #72867f; text-transform: uppercase; }
.side-section > .eyebrow { padding: 0 12px; }
.agent-list { display: grid; gap: 3px; }
.agent-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: #a9bbb5; font-size: 12px; }
.agent-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--agent-color, var(--mint)); color: var(--agent-color, var(--mint)); box-shadow: 0 0 10px currentColor; }
.color-financeiro { --agent-color: #42D392; }
.color-contabilidade { --agent-color: #6DD6E8; }
.color-atendimento { --agent-color: #FFB45E; }
.color-juridico { --agent-color: #A78BFA; }
.color-comercial { --agent-color: #4DA3FF; }
.color-marketing { --agent-color: #FF7A90; }
.color-imobiliario { --agent-color: #F6C453; }
.color-turismo { --agent-color: #35C8C3; }
.color-engenharia { --agent-color: #FF9F43; }
.agent-item.active { background: rgba(255,255,255,.035); color: var(--text); }
.agent-item.active::after { content: "ativo"; margin-left: auto; color: var(--mint); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.privacy-card { margin-top: auto; display: flex; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.privacy-icon { color: var(--mint); }
.privacy-card strong { font-size: 11px; }
.privacy-card p { margin: 3px 0 0; color: #687a74; font-size: 9px; }
main { grid-column: 2; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 88px; padding: 0 42px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.topbar .eyebrow { margin-bottom: 3px; }
.topbar h1 { margin: 0; font: 700 20px Manrope, sans-serif; }
.status { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.status.error i { background: #ff6b7d; box-shadow: 0 0 12px #ff6b7d; }
.icon-button { border: 0; background: transparent; cursor: pointer; }
.menu { display: none; font-size: 20px; margin-right: 12px; }
.welcome { width: min(760px, calc(100% - 40px)); margin: auto; padding: 54px 0 34px; text-align: center; }
.orb-wrap { position: relative; width: 82px; height: 82px; margin: 0 auto 24px; }
.orb { position: absolute; inset: 7px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #9df3ca, #209e70 45%, #0c3126 78%); box-shadow: 0 0 35px rgba(91,227,168,.2); }
.orb span { font: 800 25px Manrope, sans-serif; color: #062016; text-shadow: 0 1px 1px rgba(255,255,255,.35); }
.orbit { position: absolute; inset: 0; border: 1px solid rgba(91,227,168,.3); border-radius: 50%; animation: pulse 3s ease-in-out infinite; }
.orbit::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); top: 8px; left: 10px; box-shadow: 0 0 12px var(--mint); }
@keyframes pulse { 50% { transform: scale(1.08) rotate(180deg); opacity: .55; } }
.mint { color: var(--mint); }
.welcome h2 { margin: 0; font: 700 clamp(28px, 4vw, 44px)/1.14 Manrope, sans-serif; letter-spacing: -.035em; }
.welcome h2 span { color: #91a49d; }
.lead { max-width: 590px; margin: 18px auto 27px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: left; }
.starters button { min-width: 0; padding: 14px 13px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); cursor: pointer; transition: .2s ease; }
.starters button:hover { transform: translateY(-2px); border-color: rgba(91,227,168,.35); background: rgba(22, 42, 36, .9); }
.starters b { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--mint); background: rgba(91,227,168,.09); }
.starters span { min-width: 0; }
.starters strong, .starters small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.starters strong { font-size: 11px; }
.starters small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.starters i { margin-left: auto; color: #566963; font-style: normal; }
.conversation { display: none; width: min(850px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 190px; }
.conversation.visible { display: block; }
.welcome.hidden { display: none; }
.support-center, .operations-center { display: none; width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 70px; }
.support-center.visible { display: block; }
.operations-center.visible { display: block; }
.support-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.support-heading h2 { margin: 0; font: 700 30px Manrope, sans-serif; letter-spacing: -.025em; }
.support-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.integration-pill { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: #7f918b; background: rgba(255,255,255,.025); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.integration-pill.connected { color: var(--mint); border-color: rgba(91,227,168,.22); background: rgba(91,227,168,.07); }
.stays-strip { margin-bottom: 14px; padding: 11px 14px; display: grid; grid-template-columns: repeat(4, minmax(90px, auto)) 1fr; gap: 18px; align-items: center; border: 1px solid rgba(109,214,232,.14); border-radius: 13px; background: rgba(109,214,232,.035); }
.stays-strip div span { display: block; color: #71847d; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.stays-strip div strong { display: block; margin-top: 2px; font: 700 15px Manrope, sans-serif; }
.stays-strip p { margin: 0; color: #70827c; text-align: right; font-size: 9px; }
.secondary-button, .primary-button { border-radius: 10px; cursor: pointer; font-weight: 700; }
.secondary-button { border: 1px solid var(--line); padding: 9px 13px; background: var(--panel); color: #aebeb8; font-size: 10px; }
.primary-button { border: 0; padding: 11px 14px; background: var(--mint); color: #082017; font-size: 11px; }
.support-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.support-stats article { padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.support-stats span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.support-stats strong { display: block; margin-top: 6px; font: 700 23px Manrope, sans-serif; }
.support-layout { display: grid; grid-template-columns: minmax(290px, .78fr) minmax(360px, 1.35fr); gap: 14px; align-items: start; }
.support-form, .queue-panel { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.support-form { padding: 18px; display: grid; gap: 12px; }
.support-form h3, .queue-head h3 { margin: 0; font: 700 15px Manrope, sans-serif; }
.support-form .eyebrow, .queue-head .eyebrow { margin-bottom: 3px; }
.support-form label { display: grid; gap: 5px; color: #81938d; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.support-form input, .support-form select, .support-form textarea, .queue-head select { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; background: rgba(5, 15, 12, .6); color: var(--text); padding: 9px 10px; font: 11px "DM Sans", sans-serif; text-transform: none; letter-spacing: normal; }
.support-form input:focus, .support-form select:focus, .support-form textarea:focus { border-color: rgba(91,227,168,.45); }
.support-form textarea { min-height: 76px; field-sizing: fixed; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-feedback { min-height: 14px; margin: 0; color: var(--mint); font-size: 9px; }
.form-feedback.error { color: #ff7a90; }
.queue-panel { overflow: hidden; }
.queue-head { padding: 16px 17px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.queue-head select { width: 135px; }
.ticket-list { max-height: 610px; overflow: auto; }
.ticket-card { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.ticket-card:last-child { border-bottom: 0; }
.ticket-top { display: flex; gap: 8px; align-items: center; }
.ticket-top strong { font-size: 11px; }
.ticket-top time { margin-left: auto; color: #687b74; font-size: 8px; }
.ticket-card h4 { margin: 9px 0 5px; font-size: 12px; }
.ticket-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ticket-meta span { padding: 4px 7px; border-radius: 999px; background: rgba(255,255,255,.035); color: #8da099; font-size: 8px; text-transform: uppercase; }
.priority-critical { color: #ff6b7d !important; background: rgba(255,107,125,.1) !important; }
.priority-high { color: #ffb45e !important; background: rgba(255,180,94,.1) !important; }
.ticket-actions { margin-left: auto; }
.ticket-actions select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; background: #101d1a; color: #99aaa4; font-size: 8px; }
.empty-state { padding: 50px 20px; text-align: center; color: #667872; font-size: 11px; }
.operations-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.operations-stats article { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(18,33,29,.88), rgba(10,21,18,.78)); }
.operations-stats span, .operations-stats small { display: block; color: var(--muted); }
.operations-stats span { font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.operations-stats strong { display: block; margin: 8px 0 3px; font: 700 27px Manrope, sans-serif; }
.operations-stats small { font-size: 8px; }
.records-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.records-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px; border-bottom: 1px solid var(--line); }
.record-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.record-tab { padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.record-tab em { margin-left: 4px; color: #63766f; font-size: 8px; font-style: normal; }
.record-tab.active { color: var(--text); border-color: rgba(91,227,168,.2); background: rgba(91,227,168,.08); }
.record-tab.active em { color: var(--mint); }
.records-search { width: min(310px, 100%); display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5,15,12,.55); color: #687b74; }
.records-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.records-table { min-height: 310px; overflow-x: auto; transition: opacity .15s ease; }
.records-table.loading-records { opacity: .5; }
.records-table table { width: 100%; border-collapse: collapse; }
.records-table th { padding: 11px 14px; border-bottom: 1px solid var(--line); color: #71847d; text-align: left; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.records-table td { padding: 12px 14px; border-bottom: 1px solid rgba(211,242,228,.06); color: #aebeb8; font-size: 10px; vertical-align: middle; }
.records-table tbody tr:hover { background: rgba(255,255,255,.018); }
.records-table td strong, .records-table td small { display: block; }
.records-table td strong { color: #dbe9e4; font-size: 11px; }
.records-table td small { margin-top: 3px; color: #6e817a; font-size: 8px; }
.table-action { border: 1px solid rgba(91,227,168,.18); border-radius: 8px; padding: 6px 8px; background: rgba(91,227,168,.06); color: var(--mint); font-size: 8px; cursor: pointer; white-space: nowrap; }
.records-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.records-footer p, .records-footer span { margin: 0; color: #74877f; font-size: 9px; }
.records-footer > div { display: flex; align-items: center; gap: 9px; }
.secondary-button:disabled { opacity: .4; cursor: not-allowed; }
.message { margin: 0 0 28px; animation: arrive .28s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
.message.user { display: flex; justify-content: flex-end; }
.user-bubble { max-width: 75%; padding: 13px 16px; background: rgba(91,227,168,.13); border: 1px solid rgba(91,227,168,.16); border-radius: 16px 16px 4px 16px; font-size: 13px; line-height: 1.55; }
.aida-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mini-orb { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; color: #092219; font-weight: 800; background: linear-gradient(145deg, #94edc2, #32a876); }
.aida-head strong { font: 700 12px Manrope, sans-serif; }
.aida-head small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; }
.aida-body { margin-left: 39px; color: #ccdbd6; font-size: 13px; line-height: 1.72; white-space: pre-wrap; }
.agent-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0 39px; }
.agent-chip { border: 1px solid color-mix(in srgb, var(--agent-color, var(--mint)) 22%, transparent); border-radius: 999px; padding: 5px 9px; background: rgba(255,255,255,.025); color: #9eb0aa; font-size: 9px; }
.agent-chip b { color: var(--agent-color, var(--mint)); }
.trace { margin: 13px 0 0 39px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.trace summary { cursor: pointer; padding: 10px 12px; color: var(--muted); font-size: 10px; list-style: none; }
.trace summary::after { content: "+"; float: right; }
.trace[open] summary::after { content: "−"; }
.trace-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; padding: 0 10px 10px; }
.contribution { padding: 10px; border-radius: 9px; background: rgba(255,255,255,.025); }
.contribution strong { font-size: 10px; }
.contribution p { margin: 6px 0 0; color: #83958f; font-size: 9px; line-height: 1.45; }
.loading { margin-left: 39px; display: flex; gap: 5px; }
.loading i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); animation: dots 1s infinite alternate; }
.loading i:nth-child(2) { animation-delay: .2s; }.loading i:nth-child(3) { animation-delay: .4s; }
@keyframes dots { to { opacity: .2; transform: translateY(-4px); } }
.composer-wrap { position: fixed; z-index: 10; bottom: 0; left: 254px; right: 0; padding: 18px 32px 15px; background: linear-gradient(transparent, var(--bg) 32%); }
.composer { position: relative; width: min(850px, 100%); margin: 0 auto; padding: 10px 56px 7px 15px; border: 1px solid rgba(211,242,228,.14); border-radius: 15px; background: rgba(15, 27, 24, .96); box-shadow: var(--shadow); }
textarea { width: 100%; max-height: 130px; field-sizing: content; resize: none; border: 0; outline: 0; padding: 2px 0 8px; color: var(--text); background: transparent; font-size: 13px; line-height: 1.5; }
textarea::placeholder { color: #62756e; }
.send { position: absolute; right: 11px; top: 10px; width: 34px; height: 34px; border: 0; border-radius: 10px; color: #092219; background: var(--mint); font-size: 18px; cursor: pointer; }
.send:disabled { opacity: .35; cursor: wait; }
.composer-footer { padding-top: 7px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: #63766f; font-size: 8px; }
.consent { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.consent input { position: absolute; opacity: 0; }
.consent span { width: 20px; height: 11px; border-radius: 10px; background: #34433e; position: relative; transition: .2s; }
.consent span::after { content: ""; position: absolute; width: 7px; height: 7px; left: 2px; top: 2px; background: #83958f; border-radius: 50%; transition: .2s; }
.consent input:checked + span { background: rgba(91,227,168,.3); }
.consent input:checked + span::after { transform: translateX(9px); background: var(--mint); }
kbd { font: inherit; padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; }
.disclaimer { margin: 8px auto 0; color: #53645e; text-align: center; font-size: 8px; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { transform: translateX(-105%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .sidebar.open { transform: translateX(0); }
  main { min-height: 100vh; }
  .topbar { height: 72px; padding: 0 18px; }
  .menu { display: block; }
  .composer-wrap { left: 0; padding: 16px 14px 12px; }
  .starters { grid-template-columns: 1fr; }
  .welcome { padding-top: 42px; }
  .welcome h2 { font-size: 29px; }
  .composer-footer > span { display: none; }
  .support-center, .operations-center { width: calc(100% - 28px); padding-top: 28px; }
  .support-stats { grid-template-columns: repeat(2, 1fr); }
  .operations-stats { grid-template-columns: repeat(2, 1fr); }
  .records-toolbar { align-items: stretch; flex-direction: column; }
  .records-search { width: 100%; }
  .stays-strip { grid-template-columns: repeat(4, 1fr); gap: 9px; }
  .stays-strip p { grid-column: 1 / -1; text-align: left; }
  .support-layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .status span { display: none; }
  .conversation { width: calc(100% - 28px); padding-top: 25px; }
  .user-bubble { max-width: 90%; }
  .aida-body, .agent-chips, .trace, .loading { margin-left: 0; }
  .welcome { width: calc(100% - 28px); }
  .support-heading { align-items: flex-start; }
  .support-heading { flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .support-heading h2 { font-size: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .stays-strip { grid-template-columns: repeat(2, 1fr); }
  .operations-stats { grid-template-columns: 1fr 1fr; }
  .records-footer { align-items: flex-start; flex-direction: column; }
}

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