/* Painel Path Co. — mesmo visual do site (escuro e dourado) */

:root {
  color-scheme: dark;
  --bg: #07080a;
  --bg-2: #0b0d10;
  --surface: #101317;
  --surface-2: #14181d;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eeece8;
  --muted: #9ea0a6;
  --faint: #6d7077;
  --glow: #f1c78f;
  --light: #f3f1ed;
  --ok: #7fd39b;
  --baixa: #8fb8ff;
  --media: #f1c78f;
  --alta: #ff7a6b;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-width: thin; scrollbar-color: rgba(241, 199, 143, .35) var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(241, 199, 143, .06), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; border-radius: 6px; }

/* ---------- Login ---------- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card {
  width: min(380px, 100%);
  padding: 36px 32px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  text-align: center;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.login__mark { margin: 0 auto 18px; border-radius: 14px; }
.login h1 { font-size: 22px; font-weight: 500; }
.login p { color: var(--muted); margin-top: 6px; }
.login form { display: grid; gap: 10px; margin-top: 26px; text-align: left; }
.login label { font-size: 12px; color: var(--muted); }
.login input {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: 15px var(--font);
}
.login input:focus { outline: none; border-color: rgba(241, 199, 143, .55); }
.login button {
  height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--light);
  color: #0b0c0e;
  font-weight: 600;
  cursor: pointer;
}
.login button:disabled { opacity: .6; }
.login__erro { color: var(--alta) !important; font-size: 13px; }

/* ---------- Estrutura ---------- */

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgba(11, 13, 16, .7);
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.side__brand img { border-radius: 10px; }
.side__brand b { display: block; font-weight: 600; font-size: 15px; }
.side__brand small { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.side__nav { display: grid; gap: 2px; }
.side__nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  transition: background-color .2s, color .2s;
}
.side__nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.side__nav a.is-active { background: rgba(241, 199, 143, .08); color: var(--text); }
.side__nav a.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--glow);
}
.side__nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.side__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(127, 211, 155, .15);
  color: var(--ok);
  font: 600 11px/18px var(--font);
  font-style: normal;
  text-align: center;
}
.side__badge--alert { background: rgba(255, 122, 107, .16); color: var(--alta); }
.side__foot { margin-top: auto; display: grid; gap: 8px; padding: 0 8px; }
.side__notify, .side__logout {
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.side__notify { border-color: rgba(241, 199, 143, .4); color: var(--glow); }
.side__notify:hover, .side__logout:hover { color: var(--text); border-color: rgba(255, 255, 255, .3); }

.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live.is-on i { background: var(--ok); box-shadow: 0 0 0 4px rgba(127, 211, 155, .15); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(127, 211, 155, 0); } }

.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; font-weight: 400; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* ---------- Componentes ---------- */

.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }

.card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.card h2 { font-size: 15px; font-weight: 600; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__sub { color: var(--muted); font-size: 12.5px; }
a.card { transition: border-color .25s, transform .3s var(--ease); }
a.card:hover { border-color: var(--line-2); transform: translateY(-2px); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status--on i { background: var(--ok); box-shadow: 0 0 8px rgba(127, 211, 155, .6); }
.status--off i { background: var(--alta); box-shadow: 0 0 8px rgba(255, 122, 107, .6); }
.status--off { color: var(--alta); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.kpi { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .015); }
.kpi b { display: block; font-size: 26px; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.kpi--glow b { color: var(--glow); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.chip--alta { border-color: rgba(255, 122, 107, .45); color: var(--alta); background: rgba(255, 122, 107, .07); }
.chip--media { border-color: rgba(241, 199, 143, .45); color: var(--media); background: rgba(241, 199, 143, .07); }
.chip--baixa { border-color: rgba(143, 184, 255, .4); color: var(--baixa); background: rgba(143, 184, 255, .06); }
.chip--ok { border-color: rgba(127, 211, 155, .4); color: var(--ok); }
.chip--live { border-color: rgba(127, 211, 155, .4); color: var(--ok); }
.chip--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: none;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.btn:hover { border-color: rgba(241, 199, 143, .5); background: rgba(241, 199, 143, .06); }
.btn--light { background: var(--light); color: #0b0c0e; border-color: var(--light); font-weight: 600; }
.btn--light:hover { background: #fff; }

.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.seg button.is-on { background: rgba(255, 255, 255, .08); color: var(--text); }

.empty { padding: 28px; text-align: center; color: var(--muted); }
.note { color: var(--faint); font-size: 12px; }

/* ---------- Atividade e alertas ---------- */

.feed { display: grid; }
.feed__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  animation: enter .4s var(--ease) both;
}
.feed__item:first-child { border-top: 0; }
.feed__dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--faint); }
.feed__dot--site { background: var(--glow); }
.feed__dot--suno { background: #7fc6d3; }
.feed__dot--walnut { background: #c3a6ff; }
.feed__dot--alta { background: var(--alta); box-shadow: 0 0 8px rgba(255, 122, 107, .7); }
.feed__dot--media { background: var(--media); }
.feed__dot--baixa { background: var(--baixa); }
.feed__txt { min-width: 0; }
.feed__txt b { font-weight: 500; }
.feed__txt p { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.feed__time { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.feed__item.is-seen { opacity: .55; }
.feed__actions { display: flex; gap: 6px; margin-top: 6px; }
@keyframes enter { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Conversas do site ---------- */

.inbox {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: calc(100vh - 150px);
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.inbox__list { overflow-y: auto; border-right: 1px solid var(--line); }
.inbox__item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s;
}
.inbox__item:hover { background: rgba(255, 255, 255, .03); }
.inbox__item.is-active { background: rgba(241, 199, 143, .07); }
.inbox__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inbox__top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__top time { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.inbox__prev { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__chat { display: flex; flex-direction: column; min-width: 0; }
.inbox__chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.inbox__chat-head b { font-weight: 500; }
.inbox__log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.msg { max-width: 75%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; animation: enter .3s var(--ease) both; }
.msg small { display: block; margin-top: 4px; font-size: 10.5px; opacity: .6; }
.msg--visitante { align-self: flex-start; background: rgba(255, 255, 255, .07); border-bottom-left-radius: 4px; }
.msg--bot { align-self: flex-end; background: linear-gradient(135deg, #f3e6d2, #e6cfab); color: #121315; border-bottom-right-radius: 4px; }
.sys {
  align-self: center;
  max-width: 90%;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  white-space: pre-wrap;
}
.sys--whatsapp { border-color: rgba(127, 211, 155, .4); color: var(--ok); }
.sys--bloqueio { border-color: rgba(255, 122, 107, .45); color: var(--alta); }

/* ---------- Gráfico de barras ---------- */

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 150px; padding-top: 10px; }
.bars__col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bars__bar { width: 100%; max-width: 26px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--glow), rgba(241, 199, 143, .25)); position: relative; }
.bars__bar span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); }
.bars__lbl { font-size: 10.5px; color: var(--faint); }

.meter { display: grid; gap: 6px; }
.meter__row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.meter__track { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(241, 199, 143, .5), var(--glow)); }
.meter__fill.is-high { background: linear-gradient(90deg, #ff9f6b, var(--alta)); }

/* ---------- Avisos ---------- */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast {
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--glow);
  border-radius: 12px;
  background: rgba(20, 22, 26, .97);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9);
  animation: enter .35s var(--ease) both;
  cursor: pointer;
}
.toast--alta { border-left-color: var(--alta); }
.toast b { display: block; font-weight: 600; }
.toast p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  /* Conversas: mostra a lista ou a conversa aberta, uma de cada vez. */
  .inbox { grid-template-columns: 1fr; }
  .inbox.is-open .inbox__list { display: none; }
  .inbox:not(.is-open) .inbox__chat { display: none; }
  .inbox__list { border-right: 0; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    height: auto;
    flex-direction: row;
    gap: 0;
    padding: 6px 6px max(6px, env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(11, 13, 16, .96);
    backdrop-filter: blur(12px);
  }
  .side__brand, .side__foot { display: none; }
  .side__nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .side__nav a { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 10.5px; }
  .side__nav a.is-active::before { left: 30%; right: 30%; top: 0; bottom: auto; width: auto; height: 2px; }
  .side__badge { position: absolute; top: 2px; right: 18%; margin: 0; }
  .main { padding-bottom: 110px; }
  .inbox { height: auto; }
  .inbox__log { max-height: 60vh; }
  .msg { max-width: 88%; }
}

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