:root {
  --bg: #070b10;
  --bg-soft: #0b1119;
  --panel: #0f1620;
  --panel-2: #121b26;
  --line: #223041;
  --line-soft: #1a2533;
  --text: #e7edf5;
  --muted: #8da0b5;
  --muted-2: #64788f;
  --amber: #f5a524;
  --red: #e5484d;
  --green: #30a46c;
  --blue: #4c8dff;
  --violet: #a78bfa;
  --cyan: #22d3ee;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(76, 141, 255, 0.16), transparent 62%),
    radial-gradient(900px 520px at 100% 0%, rgba(229, 72, 77, 0.13), transparent 58%),
    radial-gradient(700px 500px at 50% 110%, rgba(245, 165, 36, 0.08), transparent 60%),
    var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(141, 160, 181, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 160, 181, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 78%);
  opacity: 0.55;
  z-index: 0;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 15px; letter-spacing: 0.01em; }

button, input { font: inherit; }

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%), var(--panel);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid rgba(245, 165, 36, 0.35);
  border-radius: 18px;
  background: rgba(245, 165, 36, 0.09);
  font-size: 28px;
}
.brand-mark.small { width: 44px; height: 44px; margin: 0; border-radius: 13px; font-size: 21px; }

.login-card h1 { margin-bottom: 8px; font-size: 34px; }
.login-card .muted { margin-bottom: 24px; }

.login-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.login-card input:focus {
  border-color: rgba(245, 165, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.12);
}

.login-card button {
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffc04d, var(--amber));
  color: #1a1205;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.login-card button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.login-card button:active { transform: translateY(0); }

.error { min-height: 20px; margin: 12px 0 0; color: #ff8b8f; font-size: 13px; }
.login-foot { margin: 18px 0 0; color: var(--muted-2); font-size: 11px; text-align: center; }

.app {
  position: relative;
  z-index: 1;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px 24px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(11, 17, 25, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand h1 { margin: 0; font-size: 20px; }
.topbar-meta { display: flex; align-items: center; gap: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}
.pill.online { border-color: rgba(48, 164, 108, 0.35); color: #9be7bf; }
.pill.online::before { background: var(--green); box-shadow: 0 0 0 4px rgba(48, 164, 108, 0.12); animation: pulse 2.2s infinite; }
.pill.reconnecting { border-color: rgba(245, 165, 36, 0.38); color: #ffd28a; }
.pill.reconnecting::before { background: var(--amber); animation: pulse 1.4s infinite; }
.pill.offline { border-color: rgba(229, 72, 77, 0.35); color: #ff9ca0; }
.pill.offline::before { background: var(--red); }

.clock { color: var(--muted); font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; white-space: nowrap; }

.ghost {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.ghost:hover { border-color: var(--muted-2); color: var(--text); }

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 16px 17px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--panel);
}
.kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--kpi-color, var(--line));
  opacity: 0.9;
}
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.kpi-value { margin: 7px 0 0; font-family: "Cascadia Mono", Consolas, monospace; font-size: 30px; font-weight: 700; line-height: 1; }
.kpi-note { margin-top: 5px; color: var(--muted-2); font-size: 11px; }

.pending-alert {
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(245, 165, 36, 0.32);
  border-radius: 12px;
  background: rgba(245, 165, 36, 0.08);
  color: #ffd28a;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 34%), var(--panel);
  box-shadow: var(--shadow);
  animation: rise 0.35s ease both;
}
.radar-panel { grid-row: span 2; }
.agreements-panel { grid-column: 1 / -1; }
.activity-panel { grid-column: 1 / -1; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head .muted { font-size: 11px; }

.list { padding: 6px 0; }
.list-empty { padding: 22px 18px; color: var(--muted-2); font-size: 13px; }

.row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 17px;
  border-bottom: 1px solid rgba(34, 48, 65, 0.5);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: rgba(255, 255, 255, 0.018); }

.date-box {
  display: grid;
  place-items: center;
  min-height: 43px;
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  font-family: "Cascadia Mono", Consolas, monospace;
  line-height: 1.1;
  text-align: center;
}
.date-box strong { font-size: 15px; }
.date-box span { color: var(--muted-2); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }

.row-title { overflow: hidden; text-overflow: ellipsis; font-weight: 650; white-space: nowrap; }
.row-sub { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-red { border: 1px solid rgba(229, 72, 77, 0.38); background: rgba(229, 72, 77, 0.12); color: #ff9ca0; }
.badge-amber { border: 1px solid rgba(245, 165, 36, 0.38); background: rgba(245, 165, 36, 0.1); color: #ffd28a; }
.badge-green { border: 1px solid rgba(48, 164, 108, 0.38); background: rgba(48, 164, 108, 0.1); color: #9be7bf; }
.badge-blue { border: 1px solid rgba(76, 141, 255, 0.38); background: rgba(76, 141, 255, 0.1); color: #a9c9ff; }
.badge-muted { border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); }

.groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  padding: 13px;
}

.group-card {
  position: relative;
  min-height: 138px;
  padding: 13px 13px 11px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}
.group-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--group-color, var(--line));
}
.group-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.group-emoji { font-size: 20px; line-height: 1; }
.group-name { margin: 7px 0 2px; font-size: 12px; font-weight: 700; line-height: 1.25; }
.group-count { font-family: "Cascadia Mono", Consolas, monospace; font-size: 21px; font-weight: 700; }
.group-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.group-meta .badge { min-width: 0; padding: 3px 6px; font-size: 9px; }
.group-tasks { margin: 9px 0 0; padding: 0; list-style: none; }
.group-tasks li {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-tasks li::before { content: "› "; color: var(--group-color, var(--muted)); }

.agenda-type { display: flex; align-items: center; gap: 6px; }
.type-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.type-dot.pericia { background: var(--amber); }

.activity-row { display: flex; align-items: center; gap: 10px; padding: 10px 17px; border-bottom: 1px solid rgba(34, 48, 65, 0.5); }
.activity-row:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }
.activity-dot.done { background: var(--green); }
.activity-main { min-width: 0; flex: 1; }
.activity-title { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.activity-sub { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.activity-date { color: var(--muted-2); font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; white-space: nowrap; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 0 4px;
  font-size: 11px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48, 164, 108, 0.3); }
  50% { box-shadow: 0 0 0 5px rgba(48, 164, 108, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .radar-panel { grid-row: auto; }
  .activity-panel { grid-column: auto; }
}

@media (max-width: 680px) {
  .app { padding: 14px 12px 28px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .topbar-meta { width: 100%; justify-content: space-between; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 48px minmax(0, 1fr); }
  .row-side { grid-column: 2; justify-content: flex-start; }
  .group-card { min-height: 120px; }
  .login-card { padding: 26px 22px; }
}

/* ---------- NAVEGACAO E GESTAO ---------- */
.login-card select {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--bg-soft);
  color: var(--text);
}
.login-card select:focus {
  border-color: rgba(245, 165, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.12);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 2px;
  overflow-x: auto;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 22, 32, 0.8);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { border-color: var(--muted-2); color: var(--text); }
.tab.active {
  border-color: rgba(245, 165, 36, 0.45);
  background: rgba(245, 165, 36, 0.11);
  color: #ffd28a;
}
.tab-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(141, 160, 181, 0.14);
  color: inherit;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.toolbar input,
.toolbar select {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 12px;
}
.toolbar input { flex: 1 1 220px; }
.toolbar select { flex: 0 1 180px; }
.toolbar input:focus,
.toolbar select:focus { border-color: rgba(245, 165, 36, 0.6); }

.primary {
  padding: 9px 13px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffc04d, var(--amber));
  color: #1a1205;
  font-weight: 800;
  cursor: pointer;
}
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: 0.6; cursor: not-allowed; }

.task-list { display: flex; flex-direction: column; }
.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 13px 17px;
  border-bottom: 1px solid rgba(34, 48, 65, 0.5);
}
.task-item:last-child { border-bottom: 0; }
.task-item.done { opacity: 0.72; }
.task-main { min-width: 0; }
.task-title { font-weight: 650; }
.task-sub {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.task-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 6px;
}
.action-btn {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.action-btn:hover { border-color: var(--muted-2); color: var(--text); }
.action-btn.complete,
.action-btn.reopen { border-color: rgba(48, 164, 108, 0.35); color: #9be7bf; }
.action-btn.move { border-color: rgba(76, 141, 255, 0.35); color: #a9c9ff; }
.action-btn.edit { border-color: rgba(245, 165, 36, 0.35); color: #ffd28a; }
.action-btn.danger { border-color: rgba(229, 72, 77, 0.35); color: #ff9ca0; }

.clickable { cursor: pointer; }
.clickable:hover { background: rgba(255, 255, 255, 0.025); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 12, 0.76);
  backdrop-filter: blur(4px);
}
.modal-card {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}
.modal-head h2 { font-size: 17px; }
#modal-close { padding: 4px 9px; font-size: 20px; line-height: 1; }
.modal-body { padding: 18px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
}
.form-field textarea { min-height: 104px; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: rgba(245, 165, 36, 0.6); }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.btn-secundario {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.btn-secundario:hover { border-color: var(--muted-2); color: var(--text); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(420px, 90vw);
  padding: 12px 15px;
  border: 1px solid rgba(48, 164, 108, 0.4);
  border-radius: 11px;
  background: #0f1a15;
  color: #b9f3d3;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.toast.error {
  border-color: rgba(229, 72, 77, 0.4);
  background: #1a0f10;
  color: #ffb3b6;
}

.case-details { display: grid; gap: 14px; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.case-item .label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.case-item .value { margin-top: 2px; font-size: 13px; }
.case-section h3 {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.case-list { margin: 0; padding-left: 16px; color: var(--muted); font-size: 12px; }
.case-list li { margin-bottom: 5px; }

@media (max-width: 780px) {
  .task-item { grid-template-columns: 1fr; }
  .task-actions { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar select { flex: 1 1 140px; }
  .case-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CENTRAL DE DEMANDAS (v2)
   ========================================================================== */

.intel-list { display: flex; flex-direction: column; }

.intel-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
}
.intel-item:last-child { border-bottom: 0; }
.intel-item.crit { border-left-color: var(--red); background: linear-gradient(90deg, rgba(229,72,77,0.07), transparent 60%); }
.intel-item.high { border-left-color: var(--amber); background: linear-gradient(90deg, rgba(245,165,36,0.06), transparent 60%); }
.intel-item.mid { border-left-color: var(--blue); }
.intel-item.low { border-left-color: var(--line); }

.intel-head { display: flex; align-items: flex-start; gap: 10px; }

.intel-score {
  min-width: 34px;
  padding: 3px 0;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.intel-item.crit .intel-score { background: rgba(229,72,77,0.18); color: #ffb3b5; }
.intel-item.high .intel-score { background: rgba(245,165,36,0.18); color: #ffd79a; }

.intel-headinfo { flex: 1; min-width: 0; }
.intel-chat {
  margin: 0;
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.intel-when { margin: 2px 0 0; color: var(--muted-2); font-size: 11px; }

.intel-badge {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.intel-text {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.intel-case { margin: 8px 0 0; color: var(--cyan); font-size: 12px; }
.intel-action { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }

.intel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.intel-actions button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.intel-actions button:hover { background: var(--line); border-color: var(--muted-2); }
.intel-actions button.ghost { background: transparent; color: var(--muted); }

.wait-item { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.wait-item:last-child { border-bottom: 0; }
.wait-chat { margin: 0; font-size: 12.5px; font-weight: 650; }
.wait-hours { margin: 3px 0 0; color: var(--amber); font-size: 11.5px; font-weight: 650; }
.wait-question { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.conn-row { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.conn-row:last-child { border-bottom: 0; }
.conn-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--muted-2); flex: none; }
.conn-row.tone-ok .conn-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(48,164,108,0.16); }
.conn-row.tone-warn .conn-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(245,165,36,0.16); }
.conn-row.tone-bad .conn-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(229,72,77,0.16); }
.conn-label { margin: 0; font-size: 12.5px; font-weight: 650; }
.conn-status { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.conn-meta { margin: 3px 0 0; color: var(--muted-2); font-size: 10.5px; }

.chat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
.chat-row:last-child { border-bottom: 0; }
.chat-label { margin: 0; font-size: 12.5px; font-weight: 600; }
.chat-meta { margin: 2px 0 0; color: var(--muted-2); font-size: 10.5px; overflow-wrap: anywhere; }
.chat-row button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); font-size: 11px; font-weight: 650; cursor: pointer; }
.chat-row button:hover { background: var(--line); }
.chat-extra { padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chat-extra button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; cursor: pointer; }

.intel-panel .list { max-height: 520px; overflow-y: auto; }
.intel-panel .list::-webkit-scrollbar { width: 8px; }
.intel-panel .list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.intel-item.hist-item { padding: 11px 18px; }
.intel-item.hist-item .intel-text { font-size: 12.5px; margin-top: 6px; color: var(--muted); }
.hist-note { margin: 8px 0 0; color: var(--green); font-size: 11.5px; font-weight: 650; }

.resolved-item { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.resolved-item:last-child { border-bottom: 0; }
.resolved-title { margin: 0; font-size: 12.5px; font-weight: 650; color: var(--green); }
.resolved-meta { margin: 4px 0 0; color: var(--muted-2); font-size: 10.5px; }
.resolved-quote { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; font-style: italic; }

.toolbar-compact { padding: 0 18px 10px; }
.toolbar-compact select { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--text); font-size: 11.5px; }

.panel-head-actions { display: flex; align-items: center; gap: 10px; }

/* Qualidade do filtro + exportacao */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.metric { background: var(--surface-2, rgba(255,255,255,.04)); border: 1px solid var(--border, rgba(255,255,255,.08)); border-radius: 10px; padding: 10px 8px; text-align: center; }
.metric-value { font-size: 20px; font-weight: 700; }
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2, #8b96a5); margin-top: 2px; }
.metrics-actions { display: flex; gap: 10px; flex-wrap: wrap; }
