/* Central de Briefing — desenho seguindo a identidade do thears.dev:
   papel quente + tinta, Space Grotesk / Space Mono, bordas grossas e sombra
   dura deslocada. A identidade fica na "moldura" (topo, botões, cabeçalhos,
   cards); os campos do formulário ficam calmos, porque o cliente passa tempo
   preenchendo e legibilidade vale mais que estilo ali. */

:root {
  --paper:  #F1E9DA;
  --paper2: #EAE0CC;
  --card:   #FBF6EC;
  --ink:    #221E18;
  --ink2:   #4A443A;
  --mute:   #8C8472;
  --blue:   #1B4DFF;
  --orange: #E8642A;
  --green:  #1E9E6A;
  --line:   #221E18;

  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow:    5px 6px 0 var(--ink);
  --shadow-lg: 8px 10px 0 var(--ink);
  --shadow-bl: 6px 7px 0 var(--blue);
  /* raio irregular: imita traço à mão, marca registrada do thears.dev */
  --wobble:  18px 12px 22px 14px / 14px 20px 12px 18px;
  --wobble2: 20px 12px 20px 12px;
}

* { box-sizing: border-box; }

/* O display do UA para [hidden] perde para qualquer regra de classe que defina
   display (ex.: .ann-panel { display: flex }). Sem isto o painel de thread do
   board nasce aberto. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  /* textura sutil de papel */
  background-image:
    radial-gradient(circle at 15% 12%, rgba(232,100,42,.05), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(27,77,255,.05), transparent 45%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
code {
  font-family: var(--mono); font-size: .88em;
  background: var(--paper2); padding: .12em .45em;
  border-radius: 4px; border: 1px solid rgba(34,30,24,.16);
}
h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -0.03em; font-weight: 700; line-height: 1.15; }
h2 { font-size: 18px; margin: 0; letter-spacing: -0.015em; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--mute); font-size: 13.5px; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 20px;
  padding: 0 22px; min-height: 64px;
  background: var(--card);
  border-bottom: 2.5px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; white-space: nowrap; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-mark { height: 30px; width: 30px; border-radius: 8px; display: block; }
.brand-x { color: var(--mute); font-family: var(--mono); font-size: 15px; }
.brand-name { font-weight: 700; letter-spacing: -0.02em; font-size: 16px; }
.brand-sub {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--mute); display: block; margin-top: -3px;
}

.topnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  padding: 7px 13px; border-radius: 999px; text-decoration: none;
  color: var(--ink2); font-size: 14px; white-space: nowrap;
  font-weight: 500; border: 2px solid transparent;
}
.topnav a:hover { border-color: var(--ink); }
.topnav a.on { background: var(--ink); color: var(--card); }

.topright { display: flex; align-items: center; gap: 12px; }
.whoami { font-size: 13px; color: var(--mute); white-space: nowrap; font-family: var(--mono); }
.logout { font-size: 13px; color: var(--mute); text-decoration: none; font-family: var(--mono); }
.logout:hover { color: var(--ink); text-decoration: underline; }
.notif-btn {
  position: relative; background: var(--paper); border: 2px solid var(--ink);
  color: var(--ink); border-radius: 999px; padding: 5px 13px;
  font-size: 12.5px; font-family: var(--mono); font-weight: 700; cursor: pointer;
}
.notif-btn:hover { background: var(--ink); color: var(--card); }
.notif-btn .badge {
  position: absolute; top: -7px; right: -7px; background: var(--orange); color: #fff;
  font-style: normal; font-size: 11px; font-weight: 700; min-width: 19px; height: 19px;
  border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
  border: 2px solid var(--card);
}
.notif-panel {
  position: fixed; right: 16px; top: 74px; z-index: 70; width: min(420px, calc(100vw - 32px));
  max-height: 70vh; overflow: auto; background: var(--card);
  border: 2.5px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px;
}
.notif-item { display: block; padding: 11px 13px; border-radius: 10px; text-decoration: none; border-bottom: 1.5px solid rgba(34,30,24,.1); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--paper2); }
.notif-item.unread { background: rgba(232,100,42,.11); }
.notif-item b { display: block; font-size: 14px; }
.notif-item span { color: var(--mute); font-size: 12.5px; }
.notif-empty { padding: 22px; text-align: center; color: var(--mute); }

/* ---------- Estrutura ---------- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 32px 22px 100px; }
.page-head { margin-bottom: 26px; }
.page-head .back {
  color: var(--mute); text-decoration: none; font-size: 12.5px;
  font-family: var(--mono); display: inline-block; margin-bottom: 10px;
}
.page-head .back:hover { color: var(--ink); }
.intro { color: var(--ink2); max-width: 66ch; }
.section-title {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--mute); margin: 0 0 12px; font-weight: 700;
}
.stack { margin-bottom: 36px; }
.stack > .card + .card { margin-top: 12px; }

.card {
  background: var(--card); border: 2.5px solid var(--ink);
  border-radius: 16px; padding: 20px; margin-bottom: 16px;
}
.card.narrow { max-width: 470px; }
.card.empty, .empty { color: var(--mute); text-align: center; padding: 30px; font-family: var(--mono); font-size: 13.5px; }

/* ---------- Cards de lista ---------- */
.row-card {
  display: block; text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease;
}
a.row-card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.row-card.static { cursor: default; }
.row-main { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; font-size: 16px; }
.row-meta { color: var(--mute); font-size: 12px; margin-top: 8px; font-family: var(--mono); }

.list { padding: 0; overflow: hidden; }
.listrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1.5px solid rgba(34,30,24,.12); text-decoration: none;
}
.listrow:last-child { border-bottom: 0; }
a.listrow:hover { background: var(--paper2); }
.listrow.static { cursor: default; }
.listrow .muted { margin-left: auto; text-align: right; }
.rowform { display: inline; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 34px; }
.stat {
  background: var(--card); border: 2.5px solid var(--ink);
  border-radius: var(--wobble2); padding: 18px;
}
.stat b { display: block; font-size: 34px; letter-spacing: -0.04em; line-height: 1.05; font-weight: 700; }
.stat span { color: var(--mute); font-size: 11.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.stat.hot { box-shadow: var(--shadow-bl); }
.stat.hot b { color: var(--blue); }

/* ---------- Chips ---------- */
.chip {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
  letter-spacing: .05em; background: var(--paper2); color: var(--ink2);
  border: 1.8px solid var(--ink); white-space: nowrap;
}
.chip.rascunho { background: var(--paper2); }
.chip.enviado, .chip.aberto { background: var(--blue); color: #fff; }
.chip.em_revisao, .chip.andamento { background: var(--orange); color: #fff; }
.chip.concluido, .chip.resolvido { background: var(--green); color: #fff; }
.chip.alert-chip { background: var(--orange); color: #fff; }
.chip.type-texto { background: var(--blue); color: #fff; }
.chip.type-imagem { background: #7C3AED; color: #fff; }
.chip.type-video { background: #DB2777; color: #fff; }
.chip.type-secao { background: var(--green); color: #fff; }
.chip.type-geral { background: var(--paper2); }

/* ---------- Progresso ---------- */
/* 13px de altura para a trilha continuar legível com 0% preenchido — mais fina
   que isso, as duas bordas se encostam e a barra vazia vira um traço sólido. */
.progress { height: 13px; background: var(--paper2); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); transition: width .35s ease; }
.progress.big { flex: 1; min-width: 130px; }
.sticky-progress {
  position: sticky; top: 64px; z-index: 40;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 18px; margin-bottom: 20px;
  background: var(--card); border: 2.5px solid var(--ink);
  border-radius: 14px; font-size: 13px; font-family: var(--mono);
}
.save-state { margin-left: auto; color: var(--mute); font-size: 12px; }
.save-state.saving { color: var(--orange); }
.save-state.saved { color: var(--green); }

/* ---------- Formulários ---------- */
label { display: block; font-size: 13px; margin-bottom: 14px; color: var(--ink2); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date],
input[type=search], select, textarea {
  width: 100%; margin-top: 6px; padding: 11px 13px;
  background: #fff; color: var(--ink);
  border: 2px solid rgba(34,30,24,.28); border-radius: 9px;
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27,77,255,.16);
}
input:disabled, textarea:disabled, select:disabled { background: var(--paper2); opacity: .75; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 10px;
  background: var(--card); color: var(--ink);
  border: 2.5px solid var(--ink);
  font-family: var(--mono); font-size: 13.5px; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .13s ease, box-shadow .13s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 3px 4px 0 var(--ink); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { box-shadow: 3px 4px 0 var(--ink); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.inline-form { display: flex; gap: 11px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1; min-width: 200px; margin-bottom: 0; }
.inline-form.addfield { border-top: 2px dashed rgba(34,30,24,.25); padding-top: 16px; margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; align-items: end; }
.form-grid label { margin-bottom: 0; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar select, .toolbar input { width: auto; margin-top: 0; }

.alert { padding: 13px 16px; border-radius: 11px; margin-bottom: 16px; font-size: 14px; border: 2.5px solid var(--ink); }
.alert.error { background: #FDE2D8; }
.alert.success { background: #D8F2E6; }
.alert.info { background: #DCE4FF; }
.pw { font-family: var(--mono); font-size: 16px; font-weight: 700; letter-spacing: .06em; background: var(--card); }

/* ---------- Login ---------- */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-shell { width: 100%; max-width: 400px; }
.login-card {
  background: var(--card); border: 3px solid var(--ink);
  border-radius: var(--wobble); padding: 34px;
  box-shadow: var(--shadow-lg);
}
.login-logos { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-logos img.mark { height: 44px; width: 44px; border-radius: 11px; }
.login-brand { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.login-sub { color: var(--mute); font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; margin: 2px 0 24px; }
.login-foot { color: var(--mute); font-size: 12px; margin: 18px 0 0; text-align: center; font-family: var(--mono); }

/* ---------- Briefing ---------- */
.section-head { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid rgba(34,30,24,.18); }
.section-num {
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: #fff;
  background: var(--ink); border-radius: 8px; padding: 5px 9px; margin-top: 1px;
}
.field { padding: 18px 0; border-bottom: 1.5px solid rgba(34,30,24,.12); }
.field:last-of-type { border-bottom: 0; }
.field.added { background: rgba(232,100,42,.1); margin: 0 -20px; padding: 18px 20px; border-radius: 11px; }
.field-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15.5px; font-weight: 700; margin-bottom: 5px; letter-spacing: -0.01em; }
.req { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .08em; }
.field-help { color: var(--mute); font-size: 13.5px; margin: 0 0 10px; max-width: 66ch; }
.answer { background: var(--paper2); border: 2px solid rgba(34,30,24,.2); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; font-size: 15px; }
.answer.empty-answer { color: var(--mute); font-style: italic; font-family: var(--mono); font-size: 13px; }
.submit-card {
  display: flex; gap: 20px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; box-shadow: var(--shadow-bl);
}
.submit-card p { margin: 5px 0 0; max-width: 58ch; }

/* Arquivos */
.dropzone {
  display: block; text-align: center; padding: 20px; cursor: pointer;
  border: 2.5px dashed rgba(34,30,24,.35); border-radius: 12px;
  color: var(--mute); font-size: 13.5px; margin: 0 0 12px; transition: .15s;
  background: var(--paper2);
}
.dropzone:hover, .dropzone.over { border-color: var(--blue); color: var(--blue); background: rgba(27,77,255,.07); }
.dropzone small { display: block; font-family: var(--mono); font-size: 11px; opacity: .8; margin-top: 4px; }
.filelist { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filechip {
  position: relative; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid var(--ink);
  border-radius: 10px; padding: 8px 11px; max-width: 270px;
}
.filechip img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; border: 1.5px solid var(--ink); }
.fileicon { font-size: 22px; text-decoration: none; width: 44px; height: 44px; display: grid; place-items: center; }
.fileinfo { min-width: 0; }
.fileinfo a { display: block; font-size: 12.5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fileinfo a:hover { color: var(--blue); }
.fileinfo small { color: var(--mute); font-family: var(--mono); font-size: 10.5px; }
.filedel { background: none; border: 0; color: var(--mute); cursor: pointer; font-size: 20px; line-height: 1; padding: 0 2px; }
.filedel:hover { color: var(--orange); }

/* Perguntas / threads */
.questions-block { box-shadow: var(--shadow-bl); }
.field-questions { margin-top: 14px; }
.question {
  background: var(--paper2); border: 2px solid var(--ink);
  border-left-width: 6px; border-radius: 11px; padding: 13px 15px; margin: 12px 0;
}
.question.resolved { border-left-color: var(--green); }
.question:not(.resolved) { border-left-color: var(--orange); }
.q-head { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.q-author { font-size: 12.5px; font-weight: 700; }
.q-date { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.q-body { margin: 0; font-size: 15px; white-space: pre-wrap; }
.q-reply { margin: 10px 0 0 16px; padding: 9px 12px; background: var(--card); border-radius: 9px; border: 1.8px solid rgba(34,30,24,.2); }
.q-reply p { margin: 3px 0 0; font-size: 14px; white-space: pre-wrap; }
.q-reply.from-admin { border-left: 4px solid var(--blue); }
.q-form { display: flex; gap: 9px; align-items: flex-end; margin-top: 10px; }
.q-form textarea { margin-top: 0; }
.ask-form { display: flex; gap: 10px; align-items: flex-end; }
.ask-form textarea { margin-top: 0; }
.ask-form.compact { margin-top: 12px; }

/* ---------- Board de comentários ---------- */
.ann-board { display: grid; gap: 12px; }
.ann-group h3 {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--mute); margin: 24px 0 10px; font-weight: 700;
}
.ann-card {
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 13px;
  padding: 16px 18px; cursor: pointer; transition: transform .13s ease, box-shadow .13s ease;
}
.ann-card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.ann-card.sel { box-shadow: var(--shadow-bl); transform: translate(-3px, -3px); }
.ann-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ann-id { font-family: var(--mono); font-size: 12px; color: var(--mute); font-weight: 700; }
.ann-body { font-size: 15px; margin: 0 0 7px; }
.ann-meta { font-family: var(--mono); font-size: 11px; color: var(--mute); display: flex; gap: 7px; flex-wrap: wrap; }
.ann-sugg { background: var(--paper2); border: 2px solid var(--ink); border-left-width: 6px; border-left-color: var(--blue); padding: 9px 12px; border-radius: 9px; font-size: 14px; margin: 8px 0; white-space: pre-wrap; }

.ann-panel {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 80;
  width: min(470px, 100vw); background: var(--card);
  border-left: 3px solid var(--ink);
  display: flex; flex-direction: column;
}
.ann-panel header { padding: 17px 20px; border-bottom: 2.5px solid var(--ink); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ann-panel .close { margin-left: auto; background: none; border: 0; color: var(--mute); font-size: 26px; cursor: pointer; line-height: 1; }
.ann-panel .body { flex: 1; overflow: auto; padding: 18px 20px; }
.ann-panel footer { padding: 15px 20px; border-top: 2.5px solid var(--ink); }
.thread-msg { padding: 11px 13px; border-radius: 10px; background: var(--paper2); margin-bottom: 10px; border: 1.8px solid rgba(34,30,24,.2); }
.thread-msg.mine { background: rgba(27,77,255,.1); border-color: var(--blue); }
.thread-msg .who { font-size: 12.5px; font-weight: 700; }
.thread-msg .when { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-left: 6px; }
.thread-msg p { margin: 4px 0 0; font-size: 14.5px; white-space: pre-wrap; }

@media (max-width: 700px) {
  .wrap { padding: 22px 15px 90px; }
  .topbar { padding: 0 15px; gap: 12px; min-height: 58px; }
  .whoami { display: none; }
  .brand-sub { display: none; }
  h1 { font-size: 25px; }
  .listrow .muted { margin-left: 0; text-align: left; width: 100%; }
  .field.added { margin: 0 -15px; padding: 18px 15px; }
  .login-card { padding: 26px; }
}
