/* ---------- Cores e medidas ---------- */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1d1c1a;
  --muted: #706b63;
  --faint: #a29d94;
  --line: #e8e3da;
  --accent: #1d1c1a;
  --radius: 14px;
  --display: "Inter Tight", Inter, system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(29, 28, 26, .04), 0 8px 24px rgba(29, 28, 26, .06);

  /* status: fundo / texto / ponto */
  --ideia-bg: #efede8;     --ideia-fg: #5f5a52;     --ideia-dot: #b3ada3;
  --producao-bg: #e7eef8;  --producao-fg: #2f5288;  --producao-dot: #5b84c4;
  --revisao-bg: #fbf1d6;   --revisao-fg: #7d5c0c;   --revisao-dot: #d9a92c;
  --aprovacao-bg: #efe9f8; --aprovacao-fg: #5a3f99; --aprovacao-dot: #9277d6;
  --aprovado-bg: #e3f1ec;  --aprovado-fg: #2b6b55;  --aprovado-dot: #4fa585;
  --publicado-bg: #e4efe2; --publicado-fg: #3c6a35; --publicado-dot: #6fa364;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514;
    --surface: #1e1d1b;
    --surface-2: #232220;
    --ink: #f1eee8;
    --muted: #a7a197;
    --faint: #6f6a62;
    --line: #2f2d2a;
    --accent: #f1eee8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);

    --ideia-bg: #2a2926;     --ideia-fg: #c4beb4;     --ideia-dot: #8a857c;
    --producao-bg: #1d2a3d;  --producao-fg: #9dbbe8;  --producao-dot: #6f97d6;
    --revisao-bg: #3a2f12;   --revisao-fg: #ecc873;   --revisao-dot: #dcae3c;
    --aprovacao-bg: #2a2342; --aprovacao-fg: #c4b5f2; --aprovacao-dot: #9d88e0;
    --aprovado-bg: #17302a;  --aprovado-fg: #8fd1b8;  --aprovado-dot: #5cb594;
    --publicado-bg: #1d2e1a; --publicado-fg: #a6d39c; --publicado-dot: #7cb571;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
@media (max-width: 640px) { .page { padding: 20px 16px 40px; } }

/* ---------- Cabeçalho ---------- */
.top { margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand svg { width: 16px; height: auto; }
.brand span { font-size: 12px; font-weight: 500; letter-spacing: .3em; }
.hello { margin-top: 28px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  letter-spacing: -.03em;
}

/* ---------- Aviso de aprovação ---------- */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--aprovacao-bg); color: var(--aprovacao-fg);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
}
.callout strong { display: block; font-weight: 600; margin-bottom: 6px; }
.callout ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.callout li button {
  border: 0; background: rgba(255, 255, 255, .55); color: inherit;
  padding: 4px 10px; border-radius: 999px; font-size: 13px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .callout li button { background: rgba(255,255,255,.08); } }
.callout li button:hover { text-decoration: underline; }
.callout .icon { font-size: 18px; line-height: 1.3; }

/* ---------- Barra de controles ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav h2 {
  margin: 0 8px; min-width: 170px;
  font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.02em;
}
.icon-btn, .text-btn {
  border: 1px solid var(--line); background: var(--surface);
  height: 34px; border-radius: 10px;
}
.icon-btn { width: 34px; font-size: 16px; line-height: 1; }
.text-btn { padding: 0 12px; font-size: 13px; color: var(--muted); }
.icon-btn:hover, .text-btn:hover { border-color: var(--faint); }

.segmented {
  display: inline-flex; padding: 3px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px;
}
.segmented button {
  border: 0; background: none; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; color: var(--muted);
}
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Filtros de status ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--muted);
}
.chip .n { color: var(--ink); font-weight: 600; }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.chip:disabled { opacity: .45; cursor: default; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* ---------- Status ---------- */
.s-ideia     { --s-bg: var(--ideia-bg);     --s-fg: var(--ideia-fg);     --s-dot: var(--ideia-dot); }
.s-producao  { --s-bg: var(--producao-bg);  --s-fg: var(--producao-fg);  --s-dot: var(--producao-dot); }
.s-revisao   { --s-bg: var(--revisao-bg);   --s-fg: var(--revisao-fg);   --s-dot: var(--revisao-dot); }
.s-aprovacao { --s-bg: var(--aprovacao-bg); --s-fg: var(--aprovacao-fg); --s-dot: var(--aprovacao-dot); }
.s-aprovado  { --s-bg: var(--aprovado-bg);  --s-fg: var(--aprovado-fg);  --s-dot: var(--aprovado-dot); }
.s-publicado { --s-bg: var(--publicado-bg); --s-fg: var(--publicado-fg); --s-dot: var(--publicado-dot); }
.dot { background: var(--s-dot); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--s-bg); color: var(--s-fg);
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.badge .dot { width: 6px; height: 6px; }

/* ---------- Calendário ---------- */
.calendar {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays div {
  padding: 10px 12px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em;
}
.day {
  min-height: 118px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: none; border-top: 0; border-left: 0; text-align: left;
}
.grid .day:nth-child(7n) { border-right: 0; }
.day.out { background: var(--surface-2); }
.day.out .num { color: var(--faint); }
.num { font-size: 13px; color: var(--muted); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.day.today .num { background: var(--ink); color: var(--bg); font-weight: 600; }
.pill {
  display: flex; align-items: center; gap: 6px; width: 100%;
  border: 0; background: var(--s-bg); color: var(--s-fg);
  border-radius: 7px; padding: 4px 7px; font-size: 12px; text-align: left;
  min-width: 0;
}
.pill span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill:hover { filter: brightness(.97); }
.more { font-size: 12px; color: var(--muted); padding-left: 4px; border: 0; background: none; text-align: left; }
.dots { display: none; gap: 3px; flex-wrap: wrap; padding: 0 2px; }

/* calendário no celular: só pontinhos, toque abre o dia */
@media (max-width: 720px) {
  .day { min-height: 58px; padding: 6px 4px; align-items: center; cursor: pointer; }
  .day .pill, .day .more { display: none; }
  .dots { display: flex; justify-content: center; }
  .dots .dot { width: 6px; height: 6px; }
  .day.selected { background: var(--surface-2); }
  .day.selected .num { outline: 1.5px solid var(--ink); }
  .weekdays div { padding: 8px 0; text-align: center; font-size: 11px; }
  .month-nav h2 { font-size: 20px; min-width: 0; }
}
.day-panel { margin-top: 16px; }
.day-panel h3 { font-size: 14px; color: var(--muted); font-weight: 500; margin: 0 0 8px; }
@media (min-width: 721px) { .day-panel { display: none; } }

/* ---------- Lista ---------- */
.list { display: flex; flex-direction: column; gap: 22px; }
.group h3 {
  margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--muted);
}
.group h3::first-letter, .day-panel h3::first-letter { text-transform: uppercase; }
.rows {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.thumb {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; color: var(--faint);
}
.row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--muted); }
.row > div { min-width: 0; }
@media (max-width: 560px) {
  .row { grid-template-columns: 48px 1fr; }
  .thumb { width: 48px; height: 48px; }
  .row .badge { grid-column: 2; justify-self: start; }
}

.empty {
  text-align: center; color: var(--muted); padding: 48px 16px;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ---------- Painel de detalhes ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(20, 19, 17, .35);
  backdrop-filter: blur(2px); z-index: 10;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 11;
  width: min(520px, 100%); background: var(--surface);
  box-shadow: -10px 0 40px rgba(0, 0, 0, .15);
  overflow-y: auto; padding: 22px 26px 40px;
  animation: slide .22s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@media (max-width: 640px) {
  .drawer {
    top: auto; width: 100%; max-height: 92vh;
    border-radius: 18px 18px 0 0; padding: 18px 16px 32px;
    animation: rise .22s ease-out;
  }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } }
}
.drawer .close {
  float: right; border: 0; background: var(--surface-2); width: 34px; height: 34px;
  border-radius: 50%; font-size: 18px; color: var(--muted);
}
.drawer h2 {
  font-family: var(--display); font-weight: 600; letter-spacing: -.025em;
  font-size: 26px; line-height: 1.15; margin: 18px 0 12px;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 18px 0 22px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.media { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.media img, .media video { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; background: var(--surface-2); }
.media a.file {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px;
}
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 0 8px; }
.caption {
  white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.6;
}
.copy { margin-top: 8px; }
.post-text { display: flex; flex-direction: column; gap: 10px; }
.post-text p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.post-text img, .post-text video { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.detail-loading { color: var(--muted); font-size: 14px; margin-top: 24px; }

/* ---------- Estados ---------- */
.loading, .message { text-align: center; color: var(--muted); padding: 80px 16px; }
.message h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; font-size: 26px; color: var(--ink); margin: 0 0 6px; }
.spinner {
  display: inline-block; width: 16px; height: 16px; margin-right: 10px; vertical-align: -3px;
  border: 2px solid var(--line); border-top-color: var(--muted); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.foot { margin-top: 36px; text-align: center; font-size: 12px; color: var(--faint); }
