/* =====================================================================
   Identidade visual - preto / cinza / branco
   Criado por Daffa Assessoria
   ===================================================================== */
:root {
  --black: #0a0a0a;          /* texto / tipografia */
  --gray: #6b7280;
  --gray-light: #f3f4f6;
  --gray-border: #e5e7eb;
  --white: #ffffff;
  --ok: #111827;
  /* cor de destaque da marca (botoes, NPS, barras, selecao) */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;  /* hover / variacao mais escura */
  --accent-light: #eff6ff;   /* fundo suave da opcao selecionada */
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-light);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }

/* ---- topo / marca ---- */
.brandbar {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0 20px;
}
.brandbar .logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; letter-spacing: -.5px;
}
.brandbar .logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.brandbar .name { font-weight: 600; font-size: 15px; }
.brandbar .name small { display: block; color: var(--gray); font-weight: 400; font-size: 12px; }

/* ---- card ---- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.4px; }
.sub { color: var(--gray); font-size: 14px; margin: 0 0 8px; }

.q { margin: 26px 0 0; }
.q:first-of-type { margin-top: 8px; }
.q > label.qlabel {
  display: block; font-weight: 600; font-size: 15px; margin-bottom: 10px;
}
.q .hint { color: var(--gray); font-weight: 400; font-size: 13px; }

/* ---- opcoes (radio/checkbox como chips) ---- */
.options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--gray-border); border-radius: 10px;
  padding: 11px 14px; cursor: pointer; font-size: 14px;
  transition: border-color .15s, background .15s;
  background: var(--white);
}
.opt:hover { border-color: var(--gray); }
.opt input { accent-color: var(--accent); width: 17px; height: 17px; }
.opt.sel { border-color: var(--accent); background: var(--accent-light); }

/* ---- escala 0..10 ---- */
.scale { display: flex; flex-wrap: wrap; gap: 6px; }
.scale .dot {
  width: 38px; height: 40px; border: 1px solid var(--gray-border);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; cursor: pointer; user-select: none;
  background: var(--white); color: var(--black);
  transition: all .12s;
}
.scale .dot:hover { border-color: var(--gray); }
.scale .dot.sel { background: var(--accent); color: var(--white); border-color: var(--accent); }
.scale-legend { display: flex; justify-content: space-between; color: var(--gray); font-size: 12px; margin-top: 6px; }

textarea, input[type="text"], input[type="tel"] {
  width: 100%; border: 1px solid var(--gray-border); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; font-family: inherit; resize: vertical;
  background: var(--white); color: var(--black);
}
textarea:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--white); border: none;
  border-radius: 11px; padding: 14px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%; margin-top: 28px;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  background: var(--white); color: var(--black); border: 1px solid var(--gray-border);
  width: auto; margin: 0; padding: 9px 16px; font-size: 13px; border-radius: 9px;
}

.err { color: #b91c1c; font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---- rodape Daffa ---- */
.daffa {
  text-align: center; margin-top: 28px;
}
.daffa a {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--gray); font-size: 12.5px;
  border: 1px solid var(--gray-border); background: var(--white);
  padding: 8px 14px; border-radius: 999px; transition: all .15s;
}
.daffa a:hover { color: var(--accent); border-color: var(--accent); }
.daffa a b { color: var(--accent); font-weight: 600; }

/* ---- tela de obrigado ---- */
.thanks { text-align: center; padding: 48px 24px; }
.thanks .check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent);
  color: var(--white); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; font-size: 30px;
}

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select, .controls input[type="date"] {
  border: 1px solid var(--gray-border); border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-family: inherit; background: var(--white); color: var(--black);
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.kpi .k-label { color: var(--gray); font-size: 12.5px; font-weight: 500; }
.kpi .k-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin-top: 4px; }
.kpi .k-sub { color: var(--gray); font-size: 12px; margin-top: 2px; }
.kpi.accent { background: var(--accent); color: var(--white); }
.kpi.accent .k-label, .kpi.accent .k-sub { color: #cbd5e1; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.panel {
  background: var(--white); border: 1px solid var(--gray-border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.panel h3 small { color: var(--gray); font-weight: 400; }
.panel.span2 { grid-column: 1 / -1; }

/* barra horizontal simples (sem libs) */
.bar-row { display: grid; grid-template-columns: 1fr; gap: 9px; }
.bar-item { font-size: 13px; }
.bar-item .bi-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.bar-item .bi-top .bi-count { color: var(--gray); font-variant-numeric: tabular-nums; }
.bar-track { height: 9px; background: var(--gray-light); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }
.bar-fill.gray { background: var(--gray); }

/* histograma nps */
.hist { display: flex; align-items: flex-end; gap: 5px; height: 130px; }
.hist .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.hist .col .h-bar { width: 100%; border-radius: 5px 5px 0 0; min-height: 2px; transition: height .5s ease; }
.hist .col .h-num { font-size: 11px; color: var(--gray); }

/* feed de comentarios */
.feed { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.cmt { border: 1px solid var(--gray-border); border-radius: 10px; padding: 12px 14px; }
.cmt .c-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.tag.promotor { background: var(--accent); color: var(--white); }
.tag.neutro { background: var(--gray-light); color: var(--gray); }
.tag.detrator { background: #fee2e2; color: #b91c1c; }
.cmt .c-store { color: var(--gray); font-size: 12px; }
.cmt .c-text { font-size: 13.5px; }

.insights ul { margin: 0; padding-left: 18px; }
.insights li { font-size: 13.5px; margin-bottom: 8px; }
.muted { color: var(--gray); font-size: 13px; }

.login-box { max-width: 360px; margin: 12vh auto 0; }

/* =====================================================================
   PLATAFORMA (app shell, console do dono, workspace do cliente)
   ===================================================================== */
/* topo escuro: usa o logo oficial branco da Daffa */
.topbar {
  background: #0d1320; border-bottom: 1px solid #1e293b;
  position: sticky; top: 0; z-index: 20;
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .logo-img { height: 30px; display: block; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #94a3b8; }
.topbar .who a { color: #93c5fd; }
.topbar .btn-ghost {
  background: transparent; color: #e2e8f0; border-color: rgba(255, 255, 255, .22);
}
.topbar .btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.pill {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-light); color: var(--accent-strong);
}
.topbar .pill { background: rgba(37, 99, 235, .22); color: #93c5fd; }
.pill.owner, .topbar .pill.owner { background: var(--accent); color: #fff; }

.page { max-width: 1180px; margin: 0 auto; padding: 26px 20px 70px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .sub { margin: 2px 0 0; }

/* tabela / lista */
.tbl { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--gray-border); }
.tbl th { background: var(--gray-light); color: var(--gray); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable:hover { background: #fafbff; cursor: pointer; }
.tbl .num { font-variant-numeric: tabular-nums; }

.badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.paused { background: #f3f4f6; color: #6b7280; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* abas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-border); margin-bottom: 22px; }
.tab {
  padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--gray);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--black); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* construtor de perguntas */
.qcard { background: var(--white); border: 1px solid var(--gray-border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.qcard .qhead { display: flex; gap: 10px; align-items: flex-start; }
.qcard .qhead .qmove { display: flex; flex-direction: column; gap: 2px; }
.iconbtn {
  border: 1px solid var(--gray-border); background: var(--white); border-radius: 7px;
  width: 30px; height: 28px; cursor: pointer; color: var(--gray); font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.iconbtn.danger:hover { border-color: #dc2626; color: #dc2626; }
.qcard input[type=text], .qcard select, .qcard textarea { width: 100%; }
.qcard .qgrid { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.qtype-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--accent-light); color: var(--accent-strong); white-space: nowrap; }
.optline { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.optline input { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray); cursor: pointer; }

/* modal */
.modal-bg { position: relative; min-height: 100%; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--white); border-radius: 16px; width: 100%; max-width: 440px;
  padding: 26px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h2 { margin: 0 0 4px; font-size: 19px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.field input { width: 100%; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }

/* link box (copiar) */
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--gray-light); border-radius: 9px; padding: 8px 8px 8px 12px; font-size: 12.5px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--black); }

.empty { text-align: center; padding: 50px 20px; color: var(--gray); }
.empty .big { font-size: 15px; color: var(--black); margin-bottom: 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { width: auto; margin: 0; padding: 9px 16px; font-size: 13px; }
