/* ===== Sidebar ===== */
.nav-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem 1rem;
  color: #2c3e50;
  border-left: 3px solid transparent;
  transition: all .15s ease;
  font-size: .82rem;
}
.nav-link:hover { background: #eef5fc; color: #1b5fbe; }
.nav-link.active {
  background: #d5e8f0;
  color: #1b5fbe;
  border-left-color: #1b5fbe;
  font-weight: 600;
}
.nav-external {
  margin-top: .25rem;
  color: #4a5568;
  font-size: .78rem;
  padding-left: 1.25rem;
  padding-right: 1rem;
  padding-top: .3rem;
  padding-bottom: .3rem;
}

/* ===== Botões padrão ===== */
.btn { @apply inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md font-medium text-xs transition; }
.btn-primary { @apply bg-primary-500 text-white hover:bg-primary-700; }
.btn-secondary { @apply bg-white border border-gray-300 hover:bg-gray-50; }
.btn-danger { @apply bg-white border border-red-300 text-danger hover:bg-red-50; }

/* ===== Tabela ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6c757d;
  padding: .55rem .8rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}
.table td {
  padding: .6rem .8rem;
  border-bottom: 1px solid #eceef1;
  font-size: .82rem;
}
.table tr:hover td { background: #eef5fc; }
.table tr:nth-child(even) td { background: #fbfdff; }
.table tr:nth-child(even):hover td { background: #eef5fc; }

/* Pílulas */
.badge {
  display: inline-block;
  padding: .1rem .5rem;
  font-size: .68rem;
  border-radius: 999px;
  font-weight: 600;
}
.badge-blue { background:#d5e8f0; color:#1b5fbe; }
.badge-green { background:#d1f5e0; color:#137a3a; }
.badge-red { background:#fde2e1; color:#b3322f; }
.badge-yellow { background:#fff4d2; color:#7a5a07; }
.badge-grey { background:#eceef1; color:#6c757d; }

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: .4rem;
  padding: .4rem .6rem;
  font-size: .82rem;
  background: white;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #4a9edb; box-shadow: 0 0 0 3px rgba(74,158,219,.18); }
.field-label { display:block; font-size:.7rem; font-weight:600; color:#4a5568; margin-bottom:.2rem; text-transform: uppercase; letter-spacing: .04em; }

/* Cards de indicadores */
.kpi {
  background:white;
  border:1px solid #eceef1;
  border-radius:.7rem;
  padding:.85rem 1rem;
  display:flex;
  flex-direction:column;
  gap:.25rem;
}
.kpi .label { font-size:.7rem; color:#6c757d; font-weight:600; text-transform:uppercase; letter-spacing: .04em; }
.kpi .value { font-size:1.5rem; font-weight:700; color:#1b5fbe; }
.kpi .sub { font-size:.72rem; color:#6c757d; }
.kpi.danger .value { color:#d9534f; }

/* Log console */
.log-console {
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  line-height: 1.35;
  padding: .6rem .8rem;
  border-radius: .5rem;
  max-height: 260px;
  overflow: auto;
}
.log-console .log-line { white-space: pre-wrap; word-break: break-word; }
.log-console .log-ts   { color: #64748b; }
.log-console .log-info { color: #93c5fd; }
.log-console .log-warn { color: #fbbf24; }
.log-console .log-error{ color: #f87171; }
.log-console .log-ok   { color: #6ee7b7; }

/* ===== Fluxo de mensagens WhatsApp ===== */
.wa-flow {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: .55rem;
  background: white;
}
.wa-flow table { width: 100%; border-collapse: collapse; font-size: .77rem; }
.wa-flow thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  font-size: .64rem;
  letter-spacing: .04em;
  padding: .45rem .65rem;
  border-bottom: 1px solid #e2e8f0;
  z-index: 1;
}
.wa-flow tbody td {
  padding: .45rem .65rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.wa-flow tbody tr:hover td { background: #f8fafc; }
.wa-flow .dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: .72rem;
}
.wa-flow .dir-in  { background: #dbeafe; color: #1d4ed8; }
.wa-flow .dir-out { background: #dcfce7; color: #166534; }
.wa-flow .dir-act { background: #f3f4f6; color: #6b7280; }
.wa-flow .msg-content {
  color: #0f172a;
  max-width: 420px;
  word-break: break-word;
  white-space: pre-wrap;
}
.wa-flow .msg-activity .msg-content { color: #64748b; font-style: italic; }
.wa-flow .wa-meta { color: #64748b; font-size: .68rem; }
.wa-flow .wa-att {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border-radius: .3rem;
  font-size: .66rem;
  padding: .05rem .35rem;
  margin-right: .2rem;
}
.wa-flow .st-ok    { color: #16a34a; }
.wa-flow .st-sent  { color: #64748b; }
.wa-flow .st-fail  { color: #dc2626; }
.wa-flow .linha-ts { font-variant-numeric: tabular-nums; color:#64748b; font-size:.7rem; }
.wa-flow-filtros { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; margin-bottom:.5rem; }
.wa-flow-filtros input[type=text] { min-width: 220px; }
.wa-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #e0e7ff;
  cursor: pointer;
  user-select: none;
}
.wa-chip.off { background: white; color:#64748b; border-color:#e5e7eb; }

