/* Ideiabot Intercom — tema escuro (uso em bastidor/eventos com pouca luz) */
:root {
  --bg: #0c1016;
  --panel: #151b24;
  --panel-2: #1c2430;
  --border: #2a3442;
  --text: #e6edf3;
  --muted: #8b98a9;
  --brand: #22c55e;
  --brand-dark: #16a34a;
  --danger: #ef4444;
  --warn: #eab308;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Layout ── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.topbar .logo img { width: 26px; height: 26px; border-radius: 6px; }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 13px; color: var(--muted); }

.nav-tabs { display: flex; gap: 4px; }
.nav-tab {
  background: transparent; border: 0; color: var(--muted);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.nav-tab.active { background: var(--panel-2); color: var(--text); }

.main { max-width: 860px; margin: 0 auto; padding: 16px; padding-bottom: 40px; }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #06210f; border: 0;
  padding: 11px 20px; border-radius: 10px; font-size: 15px; font-weight: 700;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* ── Formulários ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 11px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; font-size: 15px;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .15);
}

/* Switch */
.sw { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.sw input { display: none; }
.sw-track {
  position: absolute; inset: 0; background: var(--border); border-radius: 24px;
  transition: .2s;
}
.sw-track::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.sw input:checked + .sw-track { background: var(--brand); }
.sw input:checked + .sw-track::before { transform: translateX(18px); }

/* ── Cards ── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.card h3 { font-size: 15px; margin-bottom: 10px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

/* ── Tela do intercom ── */
.ic-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 14px;
}
.ic-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.ic-status.on .dot { background: var(--brand); box-shadow: 0 0 8px var(--brand); }
.ic-status.warn .dot { background: var(--warn); }

.canal-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.canal-card.falando-alguem { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(34,197,94,.2); }
.canal-cor { width: 12px; height: 34px; border-radius: 6px; flex: none; }
.canal-info { flex: 1; min-width: 0; }
.canal-nome { font-weight: 700; font-size: 15px; }
.canal-sub { font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 15px; }
.canal-sub .spk { color: var(--brand); font-weight: 600; }
.canal-acoes { display: flex; align-items: center; gap: 8px; }

.ic-ouvir {
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
  font-size: 19px; display: flex; align-items: center; justify-content: center;
}
.ic-ouvir.on { background: rgba(34,197,94,.15); border-color: var(--brand); color: var(--brand); }

/* Alvo de fala (chips) */
.alvo-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 10px; }
.alvo-chip {
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700;
}
.alvo-chip.on { background: rgba(34,197,94,.15); border-color: var(--brand); color: var(--brand); }

/* Botão PTT */
.ptt-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 18px; gap: 10px; }
.ptt {
  width: 150px; height: 150px; border-radius: 50%;
  border: 4px solid var(--border);
  background: radial-gradient(circle at 35% 30%, var(--panel-2), var(--panel));
  color: var(--text); font-size: 16px; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .08s, border-color .1s, background .1s;
}
.ptt .mic { font-size: 34px; }
.ptt.ativo {
  border-color: var(--brand);
  background: radial-gradient(circle at 35% 30%, #1d4a2e, #14532d);
  transform: scale(.96);
  box-shadow: 0 0 30px rgba(34,197,94,.35);
}
.ptt-dica { font-size: 12px; color: var(--muted); text-align: center; }

/* ── Tabelas admin ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge.ok { background: rgba(34,197,94,.15); color: var(--brand); }
.badge.off { background: rgba(139,152,169,.15); color: var(--muted); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 16px;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
}
.modal-box h3 { margin-bottom: 14px; font-size: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 90vw;
}
.toast.err { border-color: var(--danger); }
.toast.ok { border-color: var(--brand); }

@media (max-width: 640px) {
  .main { padding: 12px; }
  .ptt { width: 170px; height: 170px; }
}
