/* Assistente de IA — Tecnologia JayS IA (base Maia 1.20.4). Cores da empresa em /tenant.css. */
:root {
  /* JayS IA — tokens Enterprise Trust; --t / --t-dark vêm de /tenant.css (cores da empresa) */
  --verde: var(--t, #0C2A52);                                   /* cor principal da empresa */
  --verde-escuro: color-mix(in srgb, var(--t, #0C2A52) 82%, #000);
  --verde-claro: color-mix(in srgb, var(--t, #0C2A52) 75%, #fff);
  --off: #F6F8FB;          /* Branco Névoa */
  --off-claro: #F6F8FB;
  --papel: #FFFFFF;
  --grafite: #0F1B2D;      /* Tinta Naval */
  --grafite-2: #33415A;
  --muted: #55627A;        /* Aço Médio */
  --vivo: var(--t, #1F5FD6);
  --vivo-escuro: color-mix(in srgb, var(--t, #1F5FD6) 82%, #000);
  --linha: #D5DEEA;        /* Fio Aço */
  --linha-clara: rgba(255, 255, 255, .14);
  --erro: #C2362F;
  --erro-fundo: #FBECEB;
  --aviso: #96590A;
  --aviso-fundo: #FBF3E6;
  --ok-fundo: #E8F5EE;
  --raio: 6px;
  --raio-g: 8px;
  --sombra: 0 1px 2px rgba(15,27,45,.05), 0 8px 24px rgba(15,27,45,.05);
  --fonte: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --titulo: "Instrument Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--fonte); font-size: 15px; line-height: 1.55;
  color: var(--grafite); background: var(--off-claro); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--verde); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  font-weight: 600; font-size: 14px; letter-spacing: .01em; transition: background .15s, border-color .15s, opacity .15s;
  background: var(--verde); color: var(--off);
}
.btn:hover { background: var(--verde-escuro); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.accent { background: var(--vivo); color: var(--grafite); }
.btn.accent:hover { background: var(--vivo-escuro); }
.btn.ghost { background: transparent; color: var(--grafite); border-color: var(--linha); }
.btn.ghost:hover { background: rgba(31,95,214,.07); }
.btn.danger { background: transparent; color: var(--erro); border-color: rgba(179,38,30,.35); }
.btn.danger:hover { background: var(--erro-fundo); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
.icon-btn:focus-visible, .conv-item:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--vivo); outline-offset: 2px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--grafite-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--linha); background: #fff; border-radius: var(--raio); padding: 10px 12px; width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--verde); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--verde); width: 16px; height: 16px; }
.check span small { display: block; color: var(--muted); font-size: 12.5px; }

.alert { border-radius: var(--raio); padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.alert.error { background: var(--erro-fundo); color: var(--erro); }
.alert.warn { background: var(--aviso-fundo); color: var(--aviso); }
.alert.ok { background: var(--ok-fundo); color: #17804F; }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: rgba(31,95,214,.1); color: var(--verde);
}
.badge.vivo { background: var(--vivo); color: var(--grafite); }
.badge.off { background: rgba(15,27,45,.08); color: var(--muted); }
.badge.red { background: var(--erro-fundo); color: var(--erro); }

/* ---------- login ---------- */
.login-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero {
  background: var(--verde); color: var(--off); padding: 48px 56px; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden;
}
.login-hero .logo { width: min(380px, 80%); height: auto; }
.login-hero h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.12; margin: 0 0 18px; font-weight: 700; letter-spacing: -.02em; max-width: 14ch; }
.login-hero h1 em { font-style: normal; color: var(--vivo); }
.login-hero p { max-width: 46ch; opacity: .85; margin: 0; }
.login-hero .rule { height: 1px; background: var(--linha-clara); margin: 22px 0; max-width: 420px; }
.login-hero .foot { font-size: 12.5px; opacity: .65; }
.login-hero .mark-bg { position: absolute; right: -60px; bottom: -40px; width: 340px; opacity: .06; pointer-events: none; }
.login-panel { background: var(--off); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.login-card .field input { background: var(--papel); }
.login-brands { margin-top: 44px; text-align: center; width: 100%; max-width: 420px; }
.login-brands small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; letter-spacing: .03em; }
.login-brands img { width: 100%; height: auto; opacity: .9; }

/* ---------- app (chat) ---------- */
.app { display: grid; grid-template-columns: 290px 1fr; height: 100vh; }
.sidebar { background: var(--verde); color: var(--off); display: flex; flex-direction: column; min-height: 0; }
.sidebar .top { padding: 20px 18px 12px; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.sidebar .brand img { height: 26px; width: auto; }
.sidebar .brand span { font-size: 12px; opacity: .7; border-left: 1px solid var(--linha-clara); padding-left: 10px; line-height: 1.2; }
.sidebar .new-chat { width: 100%; }
.conv-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; min-height: 0; }
.conv-list h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin: 14px 8px 6px; font-weight: 600; }
.conv-item {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--off); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.conv-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .88; }
.conv-item:hover { background: rgba(255,255,255,.08); }
.conv-item.active { background: rgba(255,255,255,.14); }
.conv-item.active .t { opacity: 1; }
.conv-item .del { opacity: 0; background: none; border: 0; color: var(--off); cursor: pointer; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.conv-item:hover .del, .conv-item:focus-within .del { opacity: .7; }
.conv-item .del:hover { opacity: 1; background: rgba(255,255,255,.12); }
.sidebar .bottom { border-top: 1px solid var(--linha-clara); padding: 14px 18px 16px; font-size: 13px; }
.quota { margin-bottom: 12px; }
.quota .row { display: flex; justify-content: space-between; opacity: .8; font-size: 12px; margin-bottom: 4px; }
.bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin-bottom: 9px; }
.bar > i { display: block; height: 100%; background: var(--vivo); border-radius: 99px; width: 0; transition: width .4s; }
.bar.warn > i { background: #E5C861; }
.bar.full > i { background: #E57461; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--off); color: var(--verde); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me .who { flex: 1; min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { opacity: .65; font-size: 12px; }
.icon-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; border-radius: 8px; opacity: .8; display: inline-grid; place-items: center; }
.icon-btn:hover { opacity: 1; background: rgba(255,255,255,.1); }
.icon-btn svg { width: 18px; height: 18px; }
.sidebar .links { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.sidebar .links a, .sidebar .links button {
  font-size: 12.5px; color: var(--off); opacity: .8; text-decoration: none; background: none; border: 1px solid var(--linha-clara);
  border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.sidebar .links a:hover, .sidebar .links button:hover { opacity: 1; background: rgba(255,255,255,.08); }

.main { display: flex; flex-direction: column; min-height: 0; background: var(--off-claro); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--linha); background: var(--papel); }
.topbar .title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar select { border: 1px solid var(--linha); border-radius: 999px; padding: 6px 12px; background: #fff; font-size: 13px; max-width: 260px; }
.menu-btn { display: none; }

.thread { flex: 1; overflow-y: auto; padding: 28px 24px 12px; }
.thread-inner { max-width: 820px; margin: 0 auto; }
.empty { text-align: center; padding: 8vh 12px 0; color: var(--grafite-2); }
.empty img { width: 64px; margin-bottom: 18px; }
.empty h2 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 8px; color: var(--grafite); }
.empty p { color: var(--muted); margin: 0 auto 26px; max-width: 52ch; }
.suggestions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 640px; margin: 0 auto; }
.suggestion { text-align: left; background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px 14px; cursor: pointer; font-size: 14px; }
.suggestion b { display: block; font-size: 13px; color: var(--verde); margin-bottom: 2px; }
.suggestion:hover { border-color: var(--verde); }

.msg { display: flex; gap: 14px; margin-bottom: 22px; }
.msg .av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.msg.user .av { background: var(--off); color: var(--verde); border: 1px solid var(--linha); }
.msg.assistant .av { background: var(--verde); }
.msg.assistant .av img { width: 18px; }
.msg .body { flex: 1; min-width: 0; }
.msg .who { font-size: 12.5px; font-weight: 700; color: var(--grafite-2); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.msg .who small { font-weight: 500; color: var(--muted); }
.msg.user .content { background: var(--papel); border: 1px solid var(--linha); border-radius: 4px var(--raio-g) var(--raio-g) var(--raio-g); padding: 10px 14px; white-space: pre-wrap; word-wrap: break-word; }
.content { word-wrap: break-word; }
.content p { margin: 0 0 10px; }
.content p:last-child { margin-bottom: 0; }
.content h1, .content h2, .content h3, .content h4 { margin: 16px 0 8px; line-height: 1.3; letter-spacing: -.01em; }
.content h1 { font-size: 21px; } .content h2 { font-size: 18px; } .content h3, .content h4 { font-size: 16px; }
.content ul, .content ol { margin: 0 0 10px; padding-left: 22px; }
.content li { margin-bottom: 3px; }
.content code { font-family: var(--mono); font-size: 13px; background: rgba(31,95,214,.08); padding: 1px 5px; border-radius: 5px; }
.content pre { background: var(--grafite); color: var(--off); padding: 14px 16px; border-radius: var(--raio); overflow-x: auto; margin: 0 0 12px; position: relative; }
.content pre code { background: none; padding: 0; color: inherit; font-size: 13px; }
.content pre .copy { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.12); color: var(--off); border: 0; border-radius: 6px; font-size: 12px; padding: 3px 8px; cursor: pointer; }
.content blockquote { border-left: 3px solid var(--verde); margin: 0 0 10px; padding: 2px 0 2px 12px; color: var(--grafite-2); }
.content table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--linha); padding: 6px 10px; text-align: left; }
.content th { background: rgba(31,95,214,.06); }
.content hr { border: 0; border-top: 1px solid var(--linha); margin: 14px 0; }
.status-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--verde); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.notice { font-size: 12.5px; border-radius: 8px; padding: 6px 10px; margin-top: 8px; display: inline-block; }
.notice.dlp { background: var(--aviso-fundo); color: var(--aviso); }
.notice.err { background: var(--erro-fundo); color: var(--erro); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--linha); background: var(--papel); border-radius: var(--raio); padding: 8px 12px; font-size: 13.5px; }
.file-chip .ext { font-size: 11px; font-weight: 800; background: var(--verde); color: var(--off); padding: 3px 6px; border-radius: 5px; letter-spacing: .03em; }
.file-chip .name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip a, .file-chip button { font-size: 12.5px; font-weight: 600; color: var(--verde); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }
.preview-frame { width: 100%; height: 420px; border: 1px solid var(--linha); border-radius: var(--raio); background: #fff; margin-top: 10px; }

.composer-wrap { padding: 8px 24px 18px; }
.composer { max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--linha); border-radius: var(--raio-g); box-shadow: var(--sombra); padding: 10px 10px 8px 14px; }
.composer:focus-within { border-color: var(--verde); }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; max-height: 240px; min-height: 26px; line-height: 1.5; background: transparent; padding: 4px 0; }
.composer .row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.composer .modes { display: inline-flex; background: var(--off-claro); border-radius: 999px; padding: 3px; gap: 2px; }
.composer .modes button { border: 0; background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: var(--grafite-2); font-weight: 600; }
.composer .modes button.on { background: var(--verde); color: var(--off); }
.composer .spacer { flex: 1; }
.send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--vivo); color: var(--grafite); cursor: pointer; display: grid; place-items: center; }
.send:hover { background: var(--vivo-escuro); }
.send:disabled { background: var(--off); cursor: not-allowed; color: var(--muted); }
.send svg { width: 18px; height: 18px; }
.disclaimer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15,27,45,.45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--papel); border-radius: var(--raio-g); width: 100%; max-width: 460px; padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h3 { margin: 0 0 6px; font-size: 20px; }
.modal .sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.secret-box { font-family: var(--mono); background: var(--grafite); color: var(--vivo); padding: 12px 14px; border-radius: var(--raio); font-size: 15px; word-break: break-all; margin: 10px 0 16px; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin .sidebar .nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tab { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--off); text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14.5px; opacity: .82; }
.tab svg { width: 18px; height: 18px; opacity: .8; }
.tab:hover { background: rgba(255,255,255,.08); opacity: 1; }
.tab.active { background: rgba(255,255,255,.14); opacity: 1; box-shadow: inset 3px 0 0 var(--vivo); }
.admin-main { padding: 28px 36px 60px; overflow-y: auto; height: 100vh; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.admin-head p { margin: 4px 0 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio-g); padding: 16px 18px; }
.stat small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.stat b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.hero { background: var(--verde); color: var(--off); border-color: var(--verde); }
.stat.hero small, .stat.hero .sub { color: var(--off); opacity: .75; }
.panel { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio-g); padding: 20px 22px; margin-bottom: 18px; }
.panel h2 { font-size: 17px; margin: 0 0 4px; }
.panel > p.sub { color: var(--muted); margin: 0 0 16px; font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.data th.num { text-align: right; }
.mini-bar { height: 6px; background: rgba(31,95,214,.1); border-radius: 99px; overflow: hidden; min-width: 90px; margin-top: 4px; }
.mini-bar > i { display: block; height: 100%; background: var(--verde); }
.mini-bar.warn > i { background: #D4A72C; } .mini-bar.full > i { background: var(--erro); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.key-state { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--off-claro); border-radius: var(--raio); margin-bottom: 14px; flex-wrap: wrap; }
.key-state code { font-family: var(--mono); font-size: 13px; }
.models-list { display: grid; gap: 8px; margin-bottom: 14px; }
.model-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--linha); background: #fff; border-radius: var(--raio); padding: 10px 12px; }
.model-opt input { accent-color: var(--verde); width: 16px; height: 16px; }
.model-opt .name { flex: 1; }
.model-opt .name small { display: block; color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(to top, var(--off-claro) 70%, transparent); padding: 18px 0 4px; display: flex; gap: 10px; align-items: center; }
.audit-meta { font-family: var(--mono); font-size: 12px; color: var(--grafite-2); max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .toolbar input { border: 1px solid var(--linha); border-radius: 999px; padding: 6px 12px; background: #fff; font-size: 13.5px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--grafite); color: var(--off); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; box-shadow: var(--sombra); }
.toast.err { background: var(--erro); color: #fff; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 24px; min-height: 280px; }
  .app, .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(15,27,45,.4); }
  .menu-btn { display: inline-grid; color: var(--grafite); }
  .menu-btn:hover { background: rgba(31,95,214,.08); }
  .thread, .composer-wrap { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 10px 16px; }
  .suggestions, .grid2, .grid3 { grid-template-columns: 1fr; }
  .admin-main { padding: 70px 16px 40px; height: auto; }
  .admin .menu-btn { position: fixed; top: 12px; left: 12px; z-index: 30; background: var(--papel); border: 1px solid var(--linha); }
}
.spacer { flex: 1; }

/* ---------- anexos ---------- */
.attach-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--linha); background: transparent; color: var(--grafite-2); cursor: pointer; display: grid; place-items: center; flex: none; }
.attach-btn:hover { background: var(--off-claro); color: var(--verde); border-color: var(--verde); }
.attach-btn:focus-visible { outline: 2px solid var(--vivo); outline-offset: 2px; }
.attach-btn svg { width: 17px; height: 17px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 10px; border-bottom: 1px solid var(--linha); margin-bottom: 8px; }
.att-chip { position: relative; display: inline-flex; align-items: center; gap: 10px; max-width: 280px; background: var(--off-claro); border: 1px solid var(--linha); border-radius: var(--raio); padding: 6px 8px 6px 6px; font-size: 13px; }
.att-chip .ext { font-size: 10.5px; font-weight: 800; letter-spacing: .03em; background: var(--verde); color: var(--off); padding: 8px 6px; border-radius: 6px; min-width: 38px; text-align: center; flex: none; }
.att-chip .meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.att-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-chip small { color: var(--muted); font-size: 11.5px; display: inline-flex; align-items: center; gap: 6px; }
.att-chip small.err { color: var(--erro); }
.att-chip .dots i { width: 4px; height: 4px; }
.att-chip.error { border-color: rgba(179,38,30,.35); background: var(--erro-fundo); }
.att-chip.error .ext { background: var(--erro); color: #fff; }
.att-chip.uploading .ext { background: var(--verde-claro); }
.att-chip .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px 6px; border-radius: 6px; flex: none; }
.att-chip .x:hover { background: rgba(15,27,45,.08); color: var(--grafite); }
.att-chip .dlp-flag { position: absolute; top: -7px; right: -6px; background: var(--aviso-fundo); color: var(--aviso); border: 1px solid rgba(138,90,0,.3); font-size: 9.5px; font-weight: 800; letter-spacing: .05em; border-radius: 99px; padding: 1px 6px; }
.att-chip.sent { padding: 4px 10px 4px 4px; background: var(--papel); }
.att-chip.sent .ext { padding: 5px 6px; }
.att-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.drop-overlay { position: fixed; inset: 0 0 0 290px; z-index: 30; background: rgba(31,95,214,.88); display: grid; place-items: center; pointer-events: none; }
.drop-overlay > div { border: 2px dashed var(--vivo); border-radius: var(--raio-g); padding: 48px 64px; color: var(--off); font-size: 22px; font-weight: 700; text-align: center; letter-spacing: -.01em; }
.drop-overlay small { display: block; font-size: 13.5px; font-weight: 500; opacity: .8; margin-top: 6px; }
.disclaimer[data-img="1"]::after { content: " Imagens e PDFs enviados como imagem não passam pelo filtro automático."; color: var(--aviso); }
@media (max-width: 900px) { .drop-overlay { inset: 0; } .att-chip { max-width: 100%; } }

/* ---------- projetos, contexto, exportação ---------- */
.side-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.side-scroll .conv-list { overflow: visible; flex: none; }
.proj-list { border-bottom: 1px solid var(--linha-clara); padding-bottom: 10px; }
.nav-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 8px 4px; }
.nav-head h3 { margin: 0 !important; }
.mini-add { background: rgba(255,255,255,.12); border: 0; color: var(--off); width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1; }
.mini-add:hover { background: var(--vivo); color: var(--grafite); }
.team-name { font-size: 11.5px; font-weight: 700; color: var(--vivo); margin: 10px 10px 2px; letter-spacing: .02em; }
.empty-proj { font-size: 12.5px; opacity: .5; margin: 2px 10px 6px; }
.conv-item.proj .folder { opacity: .6; font-size: 11px; }
.title-wrap { flex: 1; min-width: 0; }
.title-wrap .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ctx:empty { display: none; }
.crumb { background: none; border: 0; padding: 0; font-size: 12px; color: var(--verde); font-weight: 700; cursor: pointer; }
.crumb:hover { text-decoration: underline; }
#source { border: 1px solid var(--linha); border-radius: 999px; padding: 6px 12px; background: #fff; font-size: 13px; max-width: 240px; }
.cost { font-weight: 500; color: var(--muted); font-size: 11.5px; margin-left: auto; font-variant-numeric: tabular-nums; }
.msg .who { flex-wrap: wrap; }
.msg.user.other .av { background: var(--verde); color: var(--off); }
.export-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.export-bar span { margin-right: 4px; }
.export-bar a { text-decoration: none; color: var(--verde); border: 1px solid var(--linha); background: var(--papel); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.export-bar a:hover { border-color: var(--verde); background: #fff; }
.project-view { padding-bottom: 40px; }
.proj-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.proj-head h2 { margin: 8px 0 4px; font-size: 26px; letter-spacing: -.02em; }
.proj-head .sub { margin: 0 0 4px; color: var(--grafite-2); }
.project-view .panel h3 { margin: 0 0 8px; font-size: 15px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-head h3 { margin: 0 !important; }
.pre { white-space: pre-wrap; margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; }
.doc-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.proj-convs { display: flex; flex-direction: column; gap: 6px; }
.proj-conv { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 10px 14px; cursor: pointer; }
.proj-conv:hover { border-color: var(--verde); }
.proj-conv .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-conv small { color: var(--muted); white-space: nowrap; }
.budget-bar { height: 10px; border-radius: 99px; background: rgba(31,95,214,.12); overflow: hidden; margin: 8px 0 4px; }
.budget-bar > i { display: block; height: 100%; background: var(--verde); }
.budget-bar.warn > i { background: #D4A72C; } .budget-bar.full > i { background: var(--erro); }
.team-card { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio-g); padding: 18px 20px; margin-bottom: 14px; }
.team-card h2 { margin: 0; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.chip { background: var(--off-claro); border: 1px solid var(--linha); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
.chip.gestor { background: var(--verde); color: var(--off); border-color: var(--verde); }
.src-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--linha); }
.src-row .name { font-weight: 600; flex: 1; min-width: 160px; }
.member-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--linha); border-radius: var(--raio); background: #fff; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--linha); }
.member-row:last-child { border-bottom: 0; }
.member-row label { flex: 1; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.member-row select { border: 1px solid var(--linha); border-radius: 8px; padding: 3px 6px; background: #fff; font-size: 13px; }
.sql { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-width: 560px; }
@media (max-width: 900px) { #source { max-width: 130px; } .proj-head .row-actions { width: 100%; } }

/* ---------- artefatos (painel lateral) ---------- */
.app.with-art { grid-template-columns: 290px minmax(0, 1fr) minmax(380px, 46%); }
.art-panel { display: flex; flex-direction: column; min-height: 0; background: var(--papel); border-left: 1px solid var(--linha); }
.art-panel[hidden] { display: none; }
.art-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--linha); background: var(--off-claro); }
.art-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.art-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.art-title small { color: var(--muted); font-size: 11.5px; }
.art-head select { max-width: 140px; padding: 6px 8px; font-size: 13px; }
.art-head .icon-btn { color: var(--grafite); font-size: 15px; }
.art-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.art-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.art-code { flex: 1; margin: 0; overflow: auto; padding: 14px 16px; font: 12.5px/1.5 var(--mono); background: var(--grafite); color: var(--off); white-space: pre-wrap; word-break: break-word; }
.art-body .export-bar { padding: 8px 14px; border-top: 1px solid var(--linha); margin: 0; }
.art-card { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--verde); background: var(--papel); border-radius: var(--raio); padding: 8px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--grafite); max-width: 100%; }
.art-card:hover { background: var(--off-claro); }
.art-card .ext { font-size: 11px; font-weight: 800; background: var(--vivo); color: var(--grafite); padding: 3px 6px; border-radius: 5px; }
.art-card .meta { display: flex; flex-direction: column; min-width: 0; }
.art-card b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-card small { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .app.with-art { grid-template-columns: 290px minmax(0, 1fr); }
  .art-panel { position: fixed; inset: 0 0 0 auto; width: min(100%, 640px); z-index: 45; box-shadow: var(--sombra); }
}
@media (max-width: 900px) { .app.with-art { grid-template-columns: 1fr; } }

/* ---------- skills ---------- */
.composer { position: relative; }
.skill-pop { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); padding: 6px; z-index: 20; max-height: 300px; overflow: auto; }
.skill-pop[hidden] { display: none; }
.skill-pop button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; color: var(--grafite); }
.skill-pop button:hover, .skill-pop button:focus { background: var(--off-claro); outline: none; }
.skill-pop small { color: var(--muted); font-size: 12.5px; }
.skill-btn { font-weight: 800; font-size: 16px; color: var(--verde); }
.kb-pick { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.field > .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }

/* ---------- admin: base de conhecimento e skills ---------- */
.kb-status { display: inline-flex; align-items: center; gap: 6px; }
.kb-progress { width: 90px; height: 6px; border-radius: 99px; background: var(--off); overflow: hidden; display: inline-block; vertical-align: middle; }
.kb-progress i { display: block; height: 100%; background: var(--vivo-escuro); }
.kb-result { border: 1px solid var(--linha); border-radius: var(--raio); padding: 10px 12px; margin-top: 8px; background: var(--off-claro); }
.kb-result b { font-size: 13px; }
.kb-result p { margin: 6px 0 0; font-size: 13px; white-space: pre-wrap; max-height: 160px; overflow: auto; }
.skill-name { font-family: var(--mono); font-weight: 700; color: var(--verde); }
textarea.mono { font-family: var(--mono); font-size: 13px; }
.side-link { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 9px 12px; border-radius: var(--raio); border: 1px solid var(--linha-clara); background: transparent; color: var(--off); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.side-link:hover { background: rgba(255, 255, 255, .08); }
.side-link svg { width: 16px; height: 16px; flex: none; }
.side-link[hidden] { display: none; }
.kb-tabs { margin-bottom: 18px; display: inline-flex; }
.kb-view .team-card h2 { font-size: 18px; }
.skill-view { max-height: 60vh; border-radius: var(--raio); }
.kb-tabs { background: var(--off); border-radius: 999px; padding: 3px; gap: 2px; }
.kb-tabs button { border: 0; background: transparent; border-radius: 999px; padding: 6px 16px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--grafite-2); }
.kb-tabs button.on { background: var(--verde); color: var(--off); }

/* ---------- listas com filtros e paginação ---------- */
.list-view { display: flex; flex-direction: column; gap: 12px; }
.lv-toolbar { flex-wrap: wrap; gap: 8px; margin: 0; }
.lv-toolbar input[type=search] { flex: 1 1 220px; min-width: 180px; }
.lv-toolbar select { flex: 0 1 auto; }
.lv-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.lv-date input { padding: 6px 8px; }
.lv-body.loading { opacity: .55; transition: opacity .15s; }
.lv-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lv-info { flex: 1; }
.lv-pages { display: flex; gap: 4px; align-items: center; }
.lv-btn { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--linha); background: var(--papel); border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; color: var(--grafite); }
.lv-btn.on { background: var(--verde); color: var(--off); border-color: var(--verde); font-weight: 700; }
.lv-btn:disabled { opacity: .4; cursor: default; }
.lv-gap { padding: 0 2px; }
.lv-foot select { padding: 5px 8px; font-size: 12.5px; }
.lv-empty { padding: 12px 0; }
.chips.small .chip { font-size: 11.5px; padding: 1px 8px; }

table.data td.pol-text { min-width: 220px; max-width: 360px; white-space: normal; line-height: 1.4; }
table.data .badge.pol-scope { white-space: nowrap; }
table.data td .badge { white-space: nowrap; }

/* login com Microsoft */
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; background: var(--papel); color: var(--grafite); border: 1px solid rgba(15,27,45,.18); }
.ms-btn:hover { background: #fff; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: rgba(15,27,45,.14); }
.sso-result { background: var(--off); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sso-box { background: var(--papel); border-radius: var(--raio-g); padding: 28px; max-width: 560px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.sso-box h1 { font-size: 22px; margin: 0 0 8px; }
.sso-box table { margin: 14px 0; }
.sso-box th { text-align: left; padding-right: 12px; white-space: nowrap; color: var(--muted); font-weight: 500; }
/* submenu das configurações */
.sub-menu { display: flex; gap: 6px; border-bottom: 1px solid rgba(15,27,45,.12); margin: -6px 0 22px; flex-wrap: wrap; }
.sub-menu button { background: none; border: 0; padding: 10px 14px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.sub-menu button svg { width: 16px; height: 16px; }
.sub-menu button.active { color: var(--grafite); border-bottom-color: var(--verde); font-weight: 600; }
.auth-methods { display: grid; gap: 10px; }
.auth-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid rgba(15,27,45,.14); border-radius: 12px; background: var(--papel); cursor: pointer; }
.auth-opt.disabled { opacity: .55; cursor: not-allowed; }
.auth-opt.current { border-color: var(--verde); box-shadow: inset 0 0 0 1px var(--verde); }
.auth-opt b { display: block; margin-bottom: 2px; }
.auth-opt .why { color: #a33; font-size: 12.5px; margin-top: 4px; }
.steps-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.steps-list li { display: flex; gap: 8px; font-size: 14px; }
.steps-list li .st { font-weight: 700; width: 18px; flex: none; }
.steps-list li.ok .st { color: #2f7d32; } .steps-list li.fail .st { color: #b3261e; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; padding: 9px 10px; background: rgba(15,27,45,.05); border-radius: 8px; overflow-wrap: anywhere; font-size: 13px; }
.howto ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; font-size: 14px; }

.mfa-qr { display: flex; justify-content: center; margin: 4px 0 14px; }
.mfa-qr img { width: 184px; height: 184px; background: #fff; border-radius: 10px; padding: 6px; }
.mfa-key { display: block; padding: 9px 10px; background: rgba(15,27,45,.06); border-radius: 8px; letter-spacing: .06em; font-size: 14px; word-break: break-all; }

/* segurança: semáforo */
.sec-summary { display: flex; gap: 22px; align-items: center; background: var(--papel); border-radius: var(--raio-g); padding: 18px 22px; margin-bottom: 22px; flex-wrap: wrap; }
.sec-score { width: 92px; height: 92px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 6px solid; }
.sec-score b { font-size: 30px; line-height: 1; }
.sec-score small { font-size: 10.5px; color: var(--muted); text-align: center; }
.sec-score.ok { border-color: #3c9a46; } .sec-score.warn { border-color: #e0a52a; } .sec-score.risk { border-color: #c8372d; }
.sec-counts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sec-counts .hint { width: 100%; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: #dff1df; color: #22662a; } .pill.warn { background: #fbefd2; color: #7a5200; }
.pill.risk { background: #f8dcd9; color: #8f1f17; } .pill.info { background: rgba(15,27,45,.08); color: var(--muted); }
.sec-group { margin-bottom: 26px; }
.sec-group h2 { font-size: 16px; margin: 0 0 12px; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.sec-card { background: var(--papel); border-radius: 14px; padding: 16px 16px 14px; border-left: 5px solid #bbb; display: flex; flex-direction: column; gap: 8px; }
.sec-card.ok { border-left-color: #3c9a46; } .sec-card.warn { border-left-color: #e0a52a; } .sec-card.risk { border-left-color: #c8372d; } .sec-card.info { border-left-color: #a5a79d; }
.sec-head { display: flex; gap: 12px; align-items: center; }
.sec-head h3 { margin: 0 0 3px; font-size: 15px; }
.sema { display: flex; flex-direction: column; gap: 3px; background: #2b2b2b; padding: 4px; border-radius: 8px; flex: none; }
.sema i { width: 11px; height: 11px; border-radius: 50%; background: #4a4c45; display: block; }
.sema.risk .r { background: #ff4d3f; box-shadow: 0 0 6px #ff4d3f; }
.sema.warn .y { background: #ffc233; box-shadow: 0 0 6px #ffc233; }
.sema.ok .g { background: #4fdb5c; box-shadow: 0 0 6px #4fdb5c; }
.sema.info i { background: #6b6d65; }
.sec-sum { margin: 0; font-size: 14px; line-height: 1.45; }
.sec-det { margin: 0; padding-left: 18px; font-size: 13px; color: var(--grafite-2); line-height: 1.5; }
.sec-rec { margin: 0; }
.sec-ctrl { border-top: 1px solid rgba(15,27,45,.1); padding-top: 10px; display: grid; gap: 8px; }
.sec-ctrl .field { margin: 0; }
.sec-card .row-actions { justify-content: flex-end; margin-top: auto; }

/* ---------- identidade visual ---------- */
.brand-upload { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: stretch; margin: 10px 0 6px; }
.brand-drop { border: 2px dashed var(--borda, #cfcdbf); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; cursor: pointer; color: var(--grafite); }
.brand-drop svg { width: 22px; height: 22px; color: var(--verde); }
.brand-drop.over, .brand-drop:hover, .brand-drop:focus-visible { border-color: var(--verde); background: rgba(25,181,209,.08); outline: none; }
.brand-group h3 { font-size: 14px; margin: 18px 0 8px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.brand-card { border: 1px solid var(--borda, #e2e1d3); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.brand-card.in-use { border-color: var(--verde); box-shadow: 0 0 0 1px var(--verde); }
.brand-thumb { height: 120px; display: grid; place-items: center; padding: 12px;
  background-color: #fff; background-image: linear-gradient(45deg, #f1f0e8 25%, transparent 25%), linear-gradient(-45deg, #f1f0e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f1f0e8 75%), linear-gradient(-45deg, transparent 75%, #f1f0e8 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.brand-thumb.dark { background: #2b2b2b; }
.brand-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.brand-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-meta select { width: 100%; }
.brand-meta .row-actions { justify-content: flex-start; }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.brand-swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.brand-swatches.big .brand-swatch { width: 30px; height: 30px; }
.brand-swatch:hover, .brand-swatch:focus-visible { transform: scale(1.12); outline: 2px solid var(--verde); outline-offset: 1px; }
.brand-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin: 10px 0 14px; }
.brand-colors { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.brand-color { display: grid; grid-template-columns: 44px 1fr 92px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--borda, #e2e1d3); border-radius: 10px; cursor: pointer; }
.brand-color.target { border-color: var(--verde); background: rgba(25,181,209,.07); }
.brand-color input[type=color] { width: 44px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.brand-color label { font-weight: 600; font-size: 13.5px; display: block; }
.brand-hex { font-family: "DejaVu Sans Mono", monospace; text-transform: uppercase; }
.brand-preview { border: 1px solid var(--borda, #e2e1d3); border-radius: 10px; overflow: hidden; background: #fff; margin-top: 4px; }
.bp-band { padding: 12px 14px; font-size: 14px; }
.bp-body { padding: 12px 14px 16px; font-size: 12.5px; }
.bp-body h4 { margin: 0 0 6px; font-size: 17px; }
.bp-bar { display: block; width: 46px; height: 4px; border-radius: 2px; margin-bottom: 8px; }
.bp-row { display: grid; grid-template-columns: 1fr 80px; padding: 5px 8px; }
.bp-row.head { font-weight: 600; border-radius: 4px 4px 0 0; }
.bp-quote { border-left: 3px solid; padding: 4px 10px; margin-top: 10px; font-style: italic; }
.row-actions.start { justify-content: flex-start; }
@media (max-width: 900px) { .brand-upload, .brand-cols { grid-template-columns: 1fr; } }

/* ---------- visão geral: filtros e gráficos ---------- */
.ov-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -6px 0 18px; }
.ov-filters select, .ov-filters input[type=date] { border: 1px solid var(--linha); border-radius: 999px; padding: 6px 12px; background: #fff; font-size: 13.5px; color: var(--grafite); }
.ov-dates { display: inline-flex; gap: 6px; align-items: center; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px;
   }
.chart-grid .chart-panel { margin: 0; min-width: 0; }
.chart-grid .chart-panel.wide { grid-column: 1 / -1; }
.chart-panel h2 { margin-bottom: 2px; }
.chart-panel .panel-head { align-items: flex-start; }
.chart-body { margin-top: 10px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid { stroke: #E9E8DF; stroke-width: 1; }
svg.chart .axis { stroke: #C9C8BA; stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
svg.chart .hit { fill: transparent; cursor: crosshair; }
svg.chart .hit:hover { fill: rgba(15,27,45,.05); }
.s1 { fill: var(--s1); background: var(--s1); } .s2 { fill: var(--s2); background: var(--s2); }
.s3 { fill: var(--s3); background: var(--s3); } .s4 { fill: var(--s4); background: var(--s4); }
.s5 { fill: var(--s5); background: var(--s5); } .s6 { fill: var(--s6); background: var(--s6); }
.s7 { fill: var(--s7); background: var(--s7); } .s8 { fill: var(--s8); background: var(--s8); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--grafite-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
i.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.chart-tip { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--linha); border-radius: 10px; padding: 8px 10px; font-size: 12.5px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); pointer-events: none; min-width: 170px; color: var(--grafite);
   }
.chart-tip b { display: block; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; } .tip-row span { flex: 1; color: var(--grafite-2); } .tip-row strong { font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.hbar:hover { background: rgba(15,27,45,.04); }
.hbar.clickable { cursor: pointer; }
.hb-label { min-width: 0; } .hb-label span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-label small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 12px; background: #F1F0E8; border-radius: 4px; overflow: hidden; }
.hb-track .fillbar { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-val { font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.link-btn { background: none; border: 0; color: var(--verde); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.conv-usage .conv-title { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; margin-right: 6px; }
.conv-usage .conv-title.muted { color: var(--muted); font-style: italic; }
.conv-usage td.num { font-variant-numeric: tabular-nums; }

/* =====================================================================
   1.17.0 — layout "dashboard": menu lateral claro, barra superior branca,
   faixa verde no topo do conteúdo e cards brancos com sombra suave.
   Mantém a paleta CostaFoods (verde 5743 C, off-white, grafite, verde vivo de acento).
   ===================================================================== */
:root {
  --fundo: #F4F4EE;
  --card: #FFFFFF;
  --sombra-card: 0 1px 2px rgba(15,27,45,.04), 0 10px 28px rgba(15,27,45,.06);
  --sombra-alta: 0 4px 10px rgba(15,27,45,.06), 0 18px 44px rgba(15,27,45,.12);
  --faixa: radial-gradient(520px 360px at 92% -80px, rgba(25,181,209,.26), transparent 70%),
           radial-gradient(circle at 74% 150%, transparent 0 170px, rgba(255,255,255,.09) 171px 173px, transparent 174px),
           radial-gradient(circle at 80% 150%, transparent 0 230px, rgba(255,255,255,.06) 231px 233px, transparent 234px),
           linear-gradient(115deg, #46503C 0%, #3E4735 45%, #2F3628 100%);
}
body { background: var(--fundo); }

/* ---------- menu lateral (chat e painel) ---------- */
.sidebar { background: var(--card); color: var(--grafite); box-shadow: 1px 0 0 var(--linha), 6px 0 24px rgba(15,27,45,.04); z-index: 5; }
.sidebar .top { padding: 22px 18px 12px; }
.sidebar .brand { margin-bottom: 20px; padding: 0 4px; }
.sidebar .brand img { height: auto; max-height: 30px; max-width: 100%; }
.conv-list h3 { color: var(--muted); opacity: 1; font-weight: 700; }
.conv-item { color: var(--grafite-2); border-radius: 10px; padding: 9px 12px; }
.conv-item .t { opacity: 1; }
.conv-item:hover { background: rgba(31,95,214,.06); color: var(--verde); }
.conv-item.active { background: var(--verde); color: var(--off); box-shadow: 0 6px 16px rgba(31,95,214,.25); }
.conv-item .del { color: inherit; }
.conv-item .del:hover { background: rgba(15,27,45,.08); }
.conv-item.active .del:hover { background: rgba(255,255,255,.16); }
.sidebar .bottom { border-top: 1px solid var(--linha); }
.quota .row { color: var(--muted); opacity: 1; }
.bar { background: rgba(31,95,214,.1); }
.bar > i { background: var(--verde); }
.avatar { background: var(--verde); color: var(--off); }
.me .who small { color: var(--muted); opacity: 1; }
.icon-btn:hover { background: rgba(31,95,214,.08); }
.sidebar .links a, .sidebar .links button { color: var(--grafite-2); opacity: 1; border-color: var(--linha); }
.sidebar .links a:hover, .sidebar .links button:hover { background: rgba(31,95,214,.06); color: var(--verde); }
.side-link { color: var(--grafite-2); border-color: var(--linha); }
.side-link:hover { background: rgba(31,95,214,.06); color: var(--verde); }
.proj-list { border-bottom-color: var(--linha); }
.mini-add { background: rgba(31,95,214,.08); color: var(--verde); }
.team-name { color: var(--verde); }
.empty-proj { color: var(--muted); opacity: 1; }

/* ---------- painel: navegação agrupada ---------- */
.admin { grid-template-columns: 260px 1fr; height: 100vh; min-height: 0; }
.admin .sidebar { height: 100vh; }
.admin .sidebar .nav { overflow-y: auto; min-height: 0; padding: 0 14px 12px; }
.nav-group { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 12px 6px; }
.nav-group:first-child { margin-top: 0; }
.tab { color: var(--grafite-2); opacity: 1; border-radius: 10px; padding: 10px 14px; font-size: 14.5px; font-weight: 500; transition: background .15s, color .15s; }
.tab svg { opacity: .9; }
.tab:hover { background: rgba(31,95,214,.06); color: var(--verde); }
.tab.active { background: var(--verde); color: var(--off); box-shadow: 0 6px 16px rgba(31,95,214,.28); font-weight: 600; }
.tab.active svg { color: var(--vivo); opacity: 1; }
.admin .sidebar .bottom { padding: 14px; }
.side-cta { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: rgba(25,181,209,.16); color: var(--verde); font-weight: 600; font-size: 14px; text-decoration: none; }
.side-cta svg { width: 18px; height: 18px; }
.side-cta:hover { background: var(--vivo); color: var(--grafite); }

/* ---------- painel: barra superior ---------- */
.admin-col { display: flex; flex-direction: column; height: 100vh; min-width: 0; }
.admin-top { flex: none; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--card); box-shadow: 0 1px 0 var(--linha); position: relative; z-index: 4; }
.top-crumb { min-width: 0; line-height: 1.25; }
.top-crumb small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.top-crumb b { font-size: 16px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-menu { position: relative; }
.me-menu .me { background: none; border: 0; padding: 6px 10px 6px 6px; border-radius: 12px; cursor: pointer; text-align: left; color: var(--grafite); }
.me-menu .me:hover, .me-menu .me[aria-expanded="true"] { background: var(--fundo); }
.me-menu .avatar { width: 36px; height: 36px; }
.me-menu .who { max-width: 220px; }
.me-drop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--card); border-radius: 12px; box-shadow: var(--sombra-alta); padding: 6px; z-index: 30; }
.me-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--grafite); text-decoration: none; font-size: 14px; cursor: pointer; text-align: left; }
.me-item svg { width: 16px; height: 16px; color: var(--muted); }
.me-item:hover { background: var(--fundo); color: var(--verde); }
.me-item:hover svg { color: var(--verde); }
#logout.me-item { color: var(--erro); }
#logout.me-item svg { color: var(--erro); }
.me-item:focus-visible, .me-menu .me:focus-visible, .side-cta:focus-visible { outline: 2px solid var(--vivo); outline-offset: 2px; }

/* ---------- painel: faixa verde atrás do topo do conteúdo ---------- */
.admin-main { flex: 1; min-height: 0; height: auto; overflow-y: auto; padding: 0 32px 60px; position: relative; background: var(--fundo); }
.admin-main::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 240px; background: var(--faixa); border-radius: 0 0 28px 28px; pointer-events: none; }
.admin-main > * { position: relative; }
.admin-main > p.sub { color: rgba(255,255,255,.85); padding-top: 28px; }
.admin-head { padding-top: 28px; margin-bottom: 22px; color: var(--off); align-items: flex-start; }
.admin-head h1 { color: #fff; font-size: 30px; }
.admin-head p { color: rgba(255,255,255,.82); }
.admin-head .hint { color: rgba(255,255,255,.75); }
.admin-head .btn.ghost { color: var(--off); border-color: rgba(255,255,255,.35); }
.admin-head .btn.ghost:hover { background: rgba(255,255,255,.12); }
.admin-head .btn:not(.ghost):not(.danger) { background: var(--vivo); color: var(--grafite); }
.admin-head .btn:not(.ghost):not(.danger):hover { background: var(--vivo-escuro); }
.admin-head .btn.danger { color: #FFD9D4; border-color: rgba(255,217,212,.4); }
.admin-head .ov-filters { flex-basis: 100%; margin: 6px 0 0; }
.admin-head .ov-filters select, .admin-head .ov-filters input[type=date], .admin-head select { border-color: transparent; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.admin-main > .sub-menu { margin: 24px 0 0; border-bottom: 0; gap: 4px; }
.admin-main > .sub-menu button { color: rgba(255,255,255,.8); border: 0; border-radius: 999px; padding: 8px 14px; margin: 0; }
.admin-main > .sub-menu button:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-main > .sub-menu button.active { color: var(--grafite); background: var(--vivo); }
.admin-main > .sub-menu + * > .admin-head { padding-top: 14px; }

/* ---------- cards ---------- */
.cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.save-bar { background: linear-gradient(to top, var(--fundo) 70%, transparent); }
.stat, .stat.hero { background: var(--card); color: var(--grafite); border: 0; border-radius: var(--raio-g); box-shadow: var(--sombra-card); padding: 18px; display: flex; align-items: center; gap: 14px; min-width: 0; }
.stat.hero small, .stat.hero .sub { color: var(--muted); opacity: 1; }
.stat-txt { min-width: 0; }
.stat b { font-size: 24px; }
.stat-ic { position: relative; width: 54px; height: 54px; flex: none; display: grid; place-items: center; color: var(--verde); }
.stat-ic .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.stat-ic > svg:not(.ring) { position: relative; width: 22px; height: 22px; }
.ring-track { fill: rgba(31,95,214,.06); stroke: rgba(31,95,214,.12); stroke-width: 4; }
.stat-ic.has-ring .ring-track { fill: none; }
.ring-arc { fill: none; stroke: var(--verde); stroke-width: 4; stroke-linecap: round; }
.stat.hero .ring-track { fill: var(--verde); stroke: var(--verde); }
.stat.hero .stat-ic { color: var(--vivo); }
.panel { background: var(--card); border: 0; box-shadow: var(--sombra-card); padding: 22px 24px; }
.chart-grid { gap: 18px; }
.modal { background: var(--card); border-radius: 18px; }

/* ---------- chat ---------- */
@media (min-width: 901px) { .app { grid-template-columns: 280px 1fr; } }  /* no celular vale o 1fr do bloco responsivo */
.main { background: var(--fundo); }
.topbar { min-height: 64px; padding: 10px 28px; background: var(--card); border-bottom: 0; box-shadow: 0 1px 0 var(--linha); position: relative; z-index: 2; }
.msg.user .content { background: var(--card); border-color: transparent; box-shadow: var(--sombra-card); }
.empty { text-align: left; max-width: 820px; margin: 3vh auto 0; padding: 34px 32px 30px; border-radius: 22px; background: var(--faixa); color: var(--off); box-shadow: var(--sombra-alta); }
.empty img { width: 52px; margin-bottom: 14px; }
.empty h2 { color: #fff; font-size: 28px; }
.empty p { color: rgba(255,255,255,.85); margin: 0 0 24px; }
.empty .suggestions { max-width: none; margin: 0; }
.suggestion { background: var(--card); border: 0; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.12); color: var(--grafite-2); transition: transform .15s, box-shadow .15s; }
.suggestion:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.composer { border-color: transparent; box-shadow: var(--sombra-alta); }
.composer:focus-within { border-color: var(--verde); }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin .menu-btn { position: static; background: none; border: 0; }
  .admin-top { padding: 0 12px; }
  .admin-main { padding: 0 16px 40px; height: auto; }
  .me-menu .who { display: none; }
  .empty { padding: 26px 20px 22px; margin-top: 0; }
  .admin-main::before { height: 330px; }
}

/* ---------- 1.17.1 — gráficos da visão geral ---------- */
:root { --s1: #2f8f4e; --s2: #2a78d6; --s3: #eda100; --s4: #e87ba4; --s5: #6250d6; --s6: #eb6834; --s7: #1baab5; --s8: #e34948; --s-other: #A9AB9F; }
.s-other { fill: var(--s-other); background: var(--s-other); }
.chart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.chart-grid .chart-panel.span1 { grid-column: span 1; }
.chart-grid .chart-panel.span2 { grid-column: span 2; }
.chart-grid .chart-panel.span3 { grid-column: 1 / -1; }
.chart-panel { display: flex; flex-direction: column; }
.chart-panel .chart-body { flex: 1; display: flex; flex-direction: column; justify-content: center; margin-top: 14px; }
.chart-panel .panel-head { align-items: flex-start; flex-wrap: wrap; row-gap: 8px; }
.chart-panel h2 { font-size: 15.5px; font-weight: 600; }
.ch-title { min-width: 0; }
.ch-title .hint { margin: 2px 0 0; font-size: 12.5px; }
.ch-headline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.ch-headline b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--grafite); }
.ch-note { font-size: 12px; font-weight: 600; color: var(--verde); background: rgba(25,181,209,.18); border-radius: 999px; padding: 2px 9px; }
.ch-side { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.ch-side .legend { margin: 0; }
i.key.dot { border-radius: 50%; width: 9px; height: 9px; }
svg.chart .grid { stroke: #E6E5DC; stroke-dasharray: 3 4; }
svg.chart .axis { stroke: #D6D5C8; }
svg.chart .tick { font-size: 11.5px; }
svg.chart .hit:hover { fill: rgba(31,95,214,.035); }
svg.chart .track { fill: #F1F0E9; }
svg.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
svg.chart .line.s1 { stroke: var(--s1); } svg.chart .line.s2 { stroke: var(--s2); } svg.chart .line.s3 { stroke: var(--s3); } svg.chart .line.s4 { stroke: var(--s4); } svg.chart .line.s5 { stroke: var(--s5); }
svg.chart .stop-hi { stop-opacity: .28; } svg.chart .stop-lo { stop-opacity: 0; }
svg.chart stop.s1 { stop-color: var(--s1); } svg.chart stop.s2 { stop-color: var(--s2); } svg.chart stop.s3 { stop-color: var(--s3); } svg.chart stop.s4 { stop-color: var(--s4); } svg.chart stop.s5 { stop-color: var(--s5); }
svg.chart .guide { stroke: #B9B8AA; stroke-width: 1; stroke-dasharray: 4 3; }
svg.chart .dot { stroke: #fff; stroke-width: 2.5; }
svg.chart .hit { cursor: crosshair; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
svg.donut { width: 100%; max-width: 210px; height: auto; display: block; overflow: visible; }
.donut-track { fill: none; stroke: #F1F0E9; }
.donut-seg { fill: none; cursor: pointer; transition: stroke-width .15s; }
.donut-seg.on { stroke-width: 28px; }
.donut-seg.s1 { stroke: var(--s1); } .donut-seg.s2 { stroke: var(--s2); } .donut-seg.s3 { stroke: var(--s3); } .donut-seg.s4 { stroke: var(--s4); }
.donut-seg.s5 { stroke: var(--s5); } .donut-seg.s6 { stroke: var(--s6); } .donut-seg.s7 { stroke: var(--s7); } .donut-seg.s8 { stroke: var(--s8); } .donut-seg.s-other { stroke: var(--s-other); }
.donut-num { font-size: 22px; font-weight: 700; fill: var(--grafite); font-family: inherit; letter-spacing: -.02em; }
.donut-lbl { font-size: 12px; fill: var(--muted); font-family: inherit; }
.donut-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.donut-legend li { display: grid; grid-template-columns: auto 1fr auto 42px; align-items: center; gap: 8px; font-size: 13px; }
.dl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--grafite-2); }
.donut-legend b { font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-legend small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.hbars { gap: 14px; }
.hbar, .hbar.with-av { display: flex; gap: 12px; align-items: center; padding: 4px 6px; margin: 0 -6px; border-radius: 10px; font-size: 13px; }
.hbar:hover { background: rgba(31,95,214,.04); }
.hbar.clickable:focus-visible { outline: 2px solid var(--vivo); outline-offset: 1px; }
.hb-av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(47,143,78,.12); color: var(--verde); }
.hb-main { flex: 1; min-width: 0; }
.hb-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.hb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hb-val { font-variant-numeric: tabular-nums; font-size: 13px; }
.hb-pct { color: var(--muted); font-size: 11.5px; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.hb-track { height: 8px; background: #F1F0E9; border-radius: 99px; overflow: hidden; }
.hb-track .fillbar { display: block; height: 100%; border-radius: 99px; }
.hb-sub { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-tip { border: 0; border-radius: 12px; padding: 10px 12px; box-shadow: var(--sombra-alta); }
.tip-row { padding: 1px 0; } .tip-row .key { border-radius: 50%; width: 9px; height: 9px; }
@media (max-width: 1250px) {
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid .chart-panel.span2 { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-grid .chart-panel.span1 { grid-column: 1 / -1; }
}
.donut-num, .donut-lbl { pointer-events: none; }
.chart-panel .panel-head { flex-wrap: nowrap; }
.chart-panel .ch-title { flex: 1; }
.chart-panel .ch-side { flex: none; max-width: 60%; justify-content: flex-end; }
.chart-panel.span1 .ch-side { max-width: none; }
svg.chart .track { fill: #F6F5EF; }
@media (max-width: 760px) { .chart-panel .panel-head { flex-wrap: wrap; } .chart-panel .ch-side { max-width: none; } }

/* 1.17.2 — conversa com resposta em andamento */
.conv-item.running .t::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%;
  background: var(--vivo, #6EE561); vertical-align: middle; animation: live-pulse 1.2s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .conv-item.running .t::after { animation: none; } }

/* 1.18.0 — busca na web sob demanda */
.composer .web-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linha); background: #fff;
  border-radius: 999px; padding: 4px 12px 4px 9px; font-size: 12.5px; font-weight: 600; color: var(--grafite-2); cursor: pointer; }
.composer .web-btn svg { width: 15px; height: 15px; }
.composer .web-btn:hover { border-color: var(--verde); }
.composer .web-btn.on { background: var(--verde); border-color: var(--verde); color: var(--off); }
.composer .web-btn:disabled { opacity: .45; cursor: not-allowed; }
.composer .web-btn:focus-visible { outline: 2px solid var(--vivo); outline-offset: 2px; }
@media (max-width: 600px) { .composer .web-btn { font-size: 0; padding: 6px 8px; gap: 0; } .composer .web-btn svg { width: 17px; height: 17px; } }

/* 1.18.2 — 6 números da Visão geral em 3 colunas (2 no tablet, 1 no celular) */
.cards.ov-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cards.ov-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards.ov-cards { grid-template-columns: 1fr; } }

/* 1.19.0 — cartão de confirmação de ações no Microsoft 365 */
.act-card { border: 1px solid var(--linha); border-left: 4px solid var(--verde); background: #fff; border-radius: 12px; padding: 12px 14px; margin: 8px 0; max-width: 640px; box-shadow: var(--sombra-card, 0 1px 3px rgba(0,0,0,.06)); }
.act-card.done { border-left-color: var(--vivo); }
.act-card.cancelled, .act-card.expired { opacity: .7; border-left-color: #A9AB9F; }
.act-head { display: flex; align-items: center; gap: 8px; }
.act-head b { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.act-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--off-claro, #F3F2EA); color: var(--verde); flex: none; }
.act-ic svg { width: 16px; height: 16px; }
.act-st { font-size: 11.5px; font-weight: 600; color: var(--grafite-2); background: var(--off-claro, #F3F2EA); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.act-card.pending .act-st { background: #FFF4D6; color: #7A5600; }
.act-card.done .act-st { background: #E3F7E0; color: #1F6B2A; }
.act-lines { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 10px 0 6px; font-size: 13px; }
.act-lines dt { color: var(--grafite-2); }
.act-lines dd { margin: 0; overflow-wrap: anywhere; }
.act-prev { font-size: 13px; margin: 6px 0; }
.act-prev summary { cursor: pointer; color: var(--verde); font-weight: 600; }
.act-prev-body { border: 1px solid var(--linha); border-radius: 8px; padding: 8px 12px; margin-top: 6px; max-height: 260px; overflow: auto; background: var(--fundo, #F4F4EE); }
.act-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.act-foot .hint { font-size: 12px; }
.act-ok { font-weight: 600; color: #1F6B2A; }
@media (max-width: 600px) { .act-lines { grid-template-columns: 1fr; } .act-lines dt { margin-top: 4px; } }
.sub-h { font-size: 14px; margin: 22px 0 4px; color: var(--grafite); }
.msg .body { min-width: 0; }
.act-card { box-sizing: border-box; max-width: min(640px, 100%); min-width: 0; }
.act-head b, .act-lines dd, .act-prev-body, .act-card .notice { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 600px) { .act-st { white-space: normal; text-align: center; } .act-card { padding: 10px 12px; } }
/* título longo da conversa não alarga a página (celular) */
.app > main, .app > .main { min-width: 0; }
@media (max-width: 900px) { .app { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 901px) { .app { grid-template-columns: 280px minmax(0, 1fr); } }
.topbar .title-wrap { min-width: 0; flex: 1; }
.topbar #convTitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 1.20.0 — tarefas agendadas */
.task-list { display: grid; gap: 12px; }
.task-card { background: #fff; border: 1px solid var(--linha); border-radius: 14px; padding: 14px 16px; box-shadow: var(--sombra-card, 0 1px 3px rgba(0,0,0,.06)); min-width: 0; }
.task-card.off { opacity: .72; }
.task-top { display: flex; align-items: center; gap: 10px; }
.task-main { flex: 1; min-width: 0; }
.task-main b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.task-prompt { margin: 10px 0 4px; font-size: 13px; color: var(--grafite-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 4.5em; overflow: hidden; }
.task-st { font-weight: 600; }
.task-st.ok { color: #1F6B2A; } .task-st.err { color: #B42318; } .task-st.run { color: #7A5600; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--grafite-2); cursor: pointer; flex: none; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.day-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--linha); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.day-chip:has(input:checked) { background: var(--verde); color: var(--off); border-color: var(--verde); }
.day-chip input { accent-color: var(--vivo); }
.field .lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.empty-tasks { background: #fff; border: 1px dashed var(--linha); border-radius: 14px; padding: 22px; text-align: center; }
.btn.danger.ghost, .btn.ghost.danger { color: #B42318; }

/* 1.20.1 — nome e descrição do assistente */
.msg .who.bot { align-items: flex-start; }
.bot-id { display: inline-flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.bot-name { font-weight: 700; color: var(--grafite); }
.bot-desc { font-size: 10.5px; font-weight: 400; color: #9A9C90; letter-spacing: .01em; margin-top: 1px; }
.msg .who.bot .cost { margin-left: auto; }
.empty-bot { display: flex; flex-direction: column; margin: 10px 0 2px; line-height: 1.2; }
.empty-bot .bot-name { color: var(--off); font-size: 15px; }
.empty-bot .bot-desc { color: rgba(255,255,255,.6); font-size: 11.5px; }
.bot-preview { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 10px 12px; background: var(--fundo, #F4F4EE); border-radius: 10px; }

/* 1.20.3 — tela inicial: quadro grande, saudação e apresentação do assistente */
.empty { padding: 52px 52px 48px; min-height: 300px; margin-top: 5vh; display: flex; flex-direction: column; justify-content: center; }
.empty img { width: 60px; margin-bottom: 22px; }
.empty h2 { font-size: 38px; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 14px; }
.empty .empty-intro { font-size: 19px; line-height: 1.45; color: rgba(255,255,255,.95); margin: 0 0 14px; max-width: 64ch; }
.empty .empty-name { color: #fff; font-weight: 700; }
.empty .empty-desc { color: var(--vivo); font-weight: 500; }
.empty .empty-text { font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,.82); margin: 0; max-width: 64ch; }
@media (max-width: 600px) { .empty { padding: 30px 22px 26px; min-height: 0; } .empty h2 { font-size: 28px; } .empty .empty-intro { font-size: 16.5px; } }
