/* ===========================================================
   Tokens — paleta viva, dois temas (clara/escura), nenhum com
   branco ou preto puro. Veio da exploração no canvas de Design
   ("app todo, vida e cor") — mesma lógica de sempre (cores sólidas
   + par "-bg" de fundo, contraste conferido WCAG AA >= 4.5:1 pra
   texto), só que mais saturada que a paleta pastel original.
   Escuro "tinta": azul quase-preto com identidade violeta/teal.
   Claro "névoa clara": lavanda bem suave, textos e cores profundos.
   Tema escolhido em <html data-theme="light|dark">; sem atributo,
   segue o sistema (js/tema.js).
   =========================================================== */
:root {
  color-scheme: light;
  --bg: #eef0f8;
  --surface: #fafbfd;
  --surface-2: #e1e3ec;
  --border: #c7c9d5;
  --text: #141833;
  --text-muted: #575d80;
  --accent: #0a6d51;
  --accent-contrast: #ffffff;
  --ok: #0b7d5c;

  --q1: #7a241c;   /* faça imediatamente - urgente/importante (coral) */
  --q1-bg: #e8d7dc;
  --q2: #4526a8;   /* decida quando - importante (violeta) */
  --q2-bg: #dcd8f6;
  --q3: #5c3c00;   /* delegue - urgente (âmbar) */
  --q3-bg: #e1dbd5;
  --q4: #333850;   /* faça depois (slate) */
  --q4-bg: #d7dae5;

  --overlay: rgba(20, 24, 51, 0.42);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(20, 24, 51, 0.07), 0 3px 10px rgba(20, 24, 51, 0.05);
  --shadow-alto: 0 12px 40px rgba(20, 24, 51, 0.22);
  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1020;
    --surface: #171d35;
    --surface-2: #1d2442;
    --border: #242d50;
    --text: #eef0fb;
    --text-muted: #8b90b8;
    --accent: #22e0a0;
    --accent-contrast: #0d1020;
    --ok: #22e0a0;
    --q1: #ff9c92;  --q1-bg: #311e29;
    --q2: #c4b6ff;  --q2-bg: #222141;
    --q3: #ffd280;  --q3-bg: #312820;
    --q4: #b7bcdb;  --q4-bg: #1e2237;
    --overlay: rgba(13, 16, 32, 0.6);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-alto: 0 12px 40px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1020;
  --surface: #171d35;
  --surface-2: #1d2442;
  --border: #242d50;
  --text: #eef0fb;
  --text-muted: #8b90b8;
  --accent: #22e0a0;
  --accent-contrast: #0d1020;
  --ok: #22e0a0;
  --q1: #ff9c92;  --q1-bg: #311e29;
  --q2: #c4b6ff;  --q2-bg: #222141;
  --q3: #ffd280;  --q3-bg: #312820;
  --q4: #b7bcdb;  --q4-bg: #1e2237;
  --overlay: rgba(13, 16, 32, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-alto: 0 12px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

/* Fundo em degradê suave, atrás dos painéis "vidro". Bem discreto — a
   função é dar profundidade, não colorir a tela; cada painel garante seu
   próprio contraste de texto por cima, então o fundo pode ser fraco. */
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 12% 0%, color-mix(in srgb, var(--accent) 10%, transparent) 0px, transparent 55%),
    radial-gradient(at 100% 0%, color-mix(in srgb, var(--q2) 10%, transparent) 0px, transparent 55%),
    radial-gradient(at 100% 100%, color-mix(in srgb, var(--q3) 8%, transparent) 0px, transparent 50%),
    radial-gradient(at 0% 100%, color-mix(in srgb, var(--q1) 6%, transparent) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, .quadrant-nome, .capacidade-numero, .metrica {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-shell[hidden] { display: none; }

/* ===========================================================
   Vidro — painéis translúcidos com desfoque, flutuando sobre o
   degradê do fundo. Cai pra fundo sólido em navegadores sem suporte
   a backdrop-filter (progressive enhancement, não quebra nada).
   =========================================================== */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .glass {
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
  }
  .glass-flat {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
  }
}
.glass-flat { background: var(--surface); }

/* Foco visível pra quem navega pelo teclado */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* ===========================================================
   Topbar / navegação
   =========================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  /* Normalmente 0. Com a faixa de demo visível (mesma posição sticky,
     ambas top:0 colidiriam), js/app.js mede a altura real da faixa e
     empurra o topbar pra baixo dela — funciona mesmo se a faixa quebrar
     em duas linhas no celular. */
  top: var(--topo-deslocado, 0px);
  z-index: 10;
}

.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar-title h1 { font-size: 17px; margin: 0; font-weight: 700; }
.topbar-actions { display: flex; gap: 6px; align-items: center; }

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 3px 8px;
  border-radius: 999px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; }

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab-btn svg { flex-shrink: 0; opacity: 0.8; }
.tab-btn.active svg { opacity: 1; color: var(--accent); }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .topbar { padding: 12px 16px; }
  .tabs { order: 3; width: 100%; }
  .tab-btn { flex: 1; padding: 8px 6px; }
}

/* ===========================================================
   Layout geral de conteúdo
   =========================================================== */
.content { padding: 24px; max-width: 1180px; margin: 0 auto; width: 100%; flex: 1; }
@media (max-width: 760px) { .content { padding: 18px 16px; } }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-header h2 { margin: 0 0 4px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.subtitle { margin: 0; color: var(--text-muted); font-size: 13.5px; max-width: 60ch; line-height: 1.45; }

.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.header-actions .filtro-select { width: auto; min-width: 160px; max-width: 280px; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .header-actions { width: 100%; }
  .header-actions .filtro-select { flex: 1; min-width: 0; max-width: none; }
}

.badge-tool {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ===========================================================
   Botões
   =========================================================== */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none; /* .btn também é usado em <a>, ex: "Sair da demonstração" */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.97); }
/* .btn agora declara display: inline-flex, o que por si vence o `display:
   none` que o navegador dá de graça pro atributo hidden — sem isso, um
   <button class="btn" hidden> continuaria visível. */
.btn[hidden] { display: none; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.btn-danger { color: var(--q1); border-color: var(--q1); background: transparent; }
.btn-concluido-feedback {
  background: var(--ok) !important; border-color: var(--ok) !important; color: var(--accent-contrast) !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-icon {
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; padding: 5px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* ===========================================================
   Metas
   =========================================================== */
.metas-grid {
  display: grid;
  grid-template-columns: 120px repeat(4, 1fr);
  gap: 10px;
}
.metas-grid .grid-head {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 4px;
  text-align: center;
}
.metas-grid .grid-label {
  display: flex; align-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px;
}
.metas-cell {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  min-height: 90px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meta-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 9px 10px 8px;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  transition: border-color 0.15s ease;
}
.meta-card:hover { border-color: var(--accent); }
.meta-card:hover { border-top-color: var(--accent); }
/* Faixa por horizonte: mesma lógica de cor dos quadrantes de tarefas,
   assim "1 ano" sempre lê como o accent em qualquer lugar do app. */
.meta-card[data-horizonte="1"] { border-top-color: var(--accent); }
.meta-card[data-horizonte="3"] { border-top-color: var(--q2); }
.meta-card[data-horizonte="5"] { border-top-color: var(--q3); }
.meta-card[data-horizonte="10"] { border-top-color: var(--q4); }
.meta-card .meta-titulo { font-weight: 700; display: block; margin-bottom: 2px; }
.meta-card .meta-prazo { color: var(--text-muted); font-size: 11.5px; display: block; }
.meta-card .meta-vence-hoje { color: var(--q3); font-weight: 700; }
.meta-card .meta-venceu { color: var(--q1); font-weight: 700; }
.meta-card .meta-contagem { color: var(--text-muted); font-size: 11.5px; display: block; margin-top: 4px; }
.meta-card .meta-contagem.vazia { font-style: italic; }

.btn-add-cell {
  margin-top: auto;
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
}
.btn-add-cell:hover, .btn-add-cell:focus-visible { opacity: 1; color: var(--accent); background: var(--surface-2); }

.metas-cell-rotulo { display: none; }

@media (max-width: 760px) {
  .metas-grid { grid-template-columns: 1fr; }
  .metas-grid .grid-head { display: none; }
  .metas-grid .grid-label { padding: 14px 2px 2px; font-size: 15px; color: var(--text); }
  .metas-cell { min-height: 0; }
  .metas-cell-rotulo { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); }
}

/* ===========================================================
   Tabelas (Projetos / WLB)
   =========================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table th.numero, .data-table td.numero { text-align: center; }
.data-table td.total-cell { font-weight: 700; }
.wlb-total-row td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }

.empty-hint { color: var(--text-muted); font-size: 13px; padding: 14px; }

.basico-legend {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

/* Projetos: posição e barra do total */
.rank { width: 1%; }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 700; font-size: 12px; font-family: var(--font-display);
}
.rank-badge-top { background: var(--accent); color: var(--accent-contrast); }
.linha-top { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.linha-top:hover { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.total-basico { display: flex; align-items: center; gap: 8px; }
.barra { flex: 1; min-width: 60px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.barra > span {
  display: block; height: 100%; border-radius: inherit; background: var(--accent);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.col-meta { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* No celular a tabela de projetos vira uma lista de cards */
@media (max-width: 760px) {
  .projetos-table { min-width: 0; }
  .projetos-table thead { display: none; }
  .projetos-table, .projetos-table tbody, .projetos-table tr, .projetos-table td { display: block; }
  .projetos-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "rank titulo editar" "rank meta meta" "rank total total" "rank notas notas";
    column-gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  .projetos-table td { border: none; padding: 0; white-space: normal; }
  .projetos-table .rank { grid-area: rank; font-size: 18px; width: auto; }
  .projetos-table .col-titulo { grid-area: titulo; }
  .projetos-table .col-meta { grid-area: meta; max-width: none; color: var(--text-muted); font-size: 12.5px; }
  .projetos-table .col-editar { grid-area: editar; }
  .projetos-table .total-cell { grid-area: total; margin: 8px 0 6px; }
  .projetos-table .notas-mobile { grid-area: notas; display: block; color: var(--text-muted); font-size: 12px; }
  .projetos-table td.nota-desktop { display: none; }
}
.notas-mobile { display: none; }

/* WLB: barra de capacidade */
.capacidade {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.capacidade-topo { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* Gauge circular: o anel some no CSS (transform: rotate) pra começar às
   12h em vez das 3h, que é a posição padrão de um <circle> em SVG. */
.capacidade-gauge-wrap { position: relative; flex-shrink: 0; width: 132px; height: 132px; }
.capacidade-gauge { width: 100%; height: 100%; }
.capacidade-gauge svg { display: block; transform: rotate(-90deg); }
.gauge-trilho { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.gauge-preenchido {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease;
}
.capacidade.estourou .gauge-preenchido { stroke: var(--q1); }
.capacidade-gauge-texto {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 1px;
  pointer-events: none;
}
.capacidade-gauge-texto strong { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.01em; }
.capacidade-gauge-texto span { font-size: 11.5px; color: var(--text-muted); }

.capacidade-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 10px; }
.capacidade-status { font-size: 14px; font-weight: 600; }
.capacidade-status.over { color: var(--q1); }
.capacidade-status.under { color: var(--ok); }
.capacidade-config { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.capacidade-config input {
  width: 72px; padding: 5px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13.5px; font-family: inherit;
}

@media (max-width: 480px) {
  .capacidade-topo { justify-content: center; text-align: center; }
  .capacidade-info { align-items: center; }
}

/* ===========================================================
   Board de Eisenhower
   =========================================================== */
.eisenhower-board {
  display: grid;
  grid-template-columns: 24px 1fr 1fr;
  grid-template-rows: auto auto 24px;
  gap: 10px;
  margin-top: 8px;
}
.board-axis {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 11px; font-weight: 700;
}
.board-axis-y { grid-row: 1 / 3; grid-column: 1; writing-mode: vertical-rl; transform: rotate(180deg); }
.board-axis-x { grid-row: 3; grid-column: 2 / 4; }

.quadrant {
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid transparent;
  border-top-width: 4px;
}
.q-faca-imediatamente { background: var(--q1-bg); border-color: color-mix(in srgb, var(--q1) 45%, transparent); border-top-color: var(--q1); }
.q-decida-quando { background: var(--q2-bg); border-top-color: var(--q2); }
.q-delegue { background: var(--q3-bg); border-top-color: var(--q3); }
.q-faca-depois { background: var(--q4-bg); border-top-color: var(--q4); }

.quadrant-title {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quadrant-nome { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.quadrant-count {
  font-size: 12px; font-weight: 700; min-width: 22px; text-align: center;
  padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--text-muted);
}
.q-faca-imediatamente .quadrant-title { color: var(--q1); font-size: 15px; }
.q-decida-quando .quadrant-title { color: var(--q2); }
.q-delegue .quadrant-title { color: var(--q3); }
.q-faca-depois .quadrant-title { color: var(--q4); }

.quadrant-sub { font-size: 11px; font-weight: 500; color: var(--text-muted); }

.quadrant-cards { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 320px; }
.quadrant-cards .empty-hint { padding: 6px 2px; }

.task-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.task-card:hover { border-color: var(--border); }
.task-card .task-titulo { font-weight: 600; }
.task-card .task-meta { color: var(--text-muted); font-size: 11px; }
.task-card .task-gut-notas {
  display: inline-block; margin-top: 3px; color: var(--text-muted);
  font-size: 10.5px; font-variant-numeric: tabular-nums;
}
.q-faca-imediatamente .task-card { padding: 10px 12px; font-size: 13.5px; }
.q-faca-depois .task-card { box-shadow: none; }

.task-gut {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.task-gut strong { color: var(--text); font-size: 12px; }
.task-gut .barra { width: 44px; min-width: 44px; height: 4px; flex: none; }
.q-faca-imediatamente .task-gut .barra > span { background: var(--q1); }
.q-decida-quando .task-gut .barra > span { background: var(--q2); }
.q-delegue .task-gut .barra > span { background: var(--q3); }
.q-faca-depois .task-gut .barra > span { background: var(--q4); }

.concluidas-wrap { margin-top: 18px; }
.concluidas-wrap summary { cursor: pointer; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.concluidas-wrap .quadrant-cards { max-height: none; margin-top: 10px; }
.concluidas-wrap .task-card { opacity: 0.65; }
.concluidas-wrap .task-titulo { text-decoration: line-through; }

@media (max-width: 760px) {
  .eisenhower-board { grid-template-columns: 1fr; grid-template-rows: auto; }
  .board-axis { display: none; }
  .quadrant { min-height: 0; }
}

/* ===========================================================
   Avisos (revisão semanal + tarefas paradas) numa faixa só
   =========================================================== */
.avisos {
  display: none;
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.avisos:has(> :not([hidden])) { display: block; }
.revisao-banner[hidden] { display: none; }
.revisao-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 9px 14px 9px 12px;
  border-left: 4px solid var(--q3);
}
.revisao-banner + .revisao-banner { border-top: 1px solid var(--border); }
.paradas-banner { border-left-color: var(--q1); }

.task-card-parada { border-color: var(--q1); }
.task-stuck-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--q1);
  margin-top: 4px;
}
.btn-quebrar-procrastinacao {
  margin-left: 6px;
  border: none;
  background: var(--q1);
  color: var(--accent-contrast);
  font-size: 10.5px;
  font-weight: 700;
  font-family: inherit;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.mini-prazo-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.mini-prazo-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.atrasado-tag {
  color: var(--q1);
  font-weight: 700;
  font-size: 11px;
  margin-left: 6px;
}

/* ===========================================================
   Formulário de tarefa: notas GUT em botões + prévia do quadrante
   =========================================================== */
.nota-grupo { border: none; padding: 0; margin: 0 0 12px; }
.nota-grupo legend { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 0; margin-bottom: 5px; }
.nota-grupo legend span { font-weight: 400; }
.nota-opcoes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.nota-opcoes label { position: relative; }
.nota-opcoes input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nota-opcoes span {
  display: block; text-align: center; padding: 7px 0; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg); font-weight: 700; font-size: 13.5px;
}
.nota-opcoes input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.nota-opcoes input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.gut-preview {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-top: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.gut-preview strong { font-size: 13.5px; }
.gut-preview[data-quad="faca-imediatamente"] { background: var(--q1-bg); color: var(--q1); }
.gut-preview[data-quad="decida-quando"] { background: var(--q2-bg); color: var(--q2); }
.gut-preview[data-quad="delegue"] { background: var(--q3-bg); color: var(--q3); }
.gut-preview[data-quad="faca-depois"] { background: var(--q4-bg); color: var(--q4); }

/* ===========================================================
   Inputs
   =========================================================== */
.mini-input {
  width: 52px;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}
.text-input, .select-input, textarea.text-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
}
.header-actions .select-input { background: var(--surface); }

/* ===========================================================
   Modal
   =========================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 100;
  animation: overlay-in 0.15s ease-out;
}
.modal-overlay[hidden] { display: none; }
.modal {
  border-radius: var(--radius-lg);
  padding: 22px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-alto);
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal h3 { margin-top: 0; font-size: 16px; }
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-row label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-row-inline { display: flex; gap: 10px; }
.form-row-inline .form-row { flex: 1; }
.form-actions { display: flex; justify-content: space-between; margin-top: 18px; gap: 8px; flex-wrap: wrap; }
.form-actions-right { display: flex; gap: 8px; }

.gut-inputs, .basico-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.basico-inputs { grid-template-columns: repeat(2, 1fr); }
.scale-hint { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* ===========================================================
   Rodapé e aviso de privacidade
   =========================================================== */
.app-footer {
  text-align: center;
  padding: 18px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.app-footer p { margin: 0; line-height: 1.6; }
.app-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.app-footer a:hover { text-decoration: underline; }

.aviso-privacidade {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 560px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-alto);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 90;
}
.aviso-privacidade[hidden] { display: none; }
.aviso-privacidade p { margin: 0; font-size: 12.5px; line-height: 1.45; }
.aviso-privacidade a { color: var(--accent); font-weight: 600; }
.aviso-privacidade .btn { flex-shrink: 0; }

/* ===========================================================
   Tela de login (app.html, antes do app aparecer)
   =========================================================== */
.auth-gate {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 32px 16px;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 380px;
  padding: 30px 26px 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-alto);
}
.auth-marca { text-align: center; margin-bottom: 22px; }
.auth-marca svg { color: var(--accent); display: block; margin: 0 auto 12px; }
.auth-marca h1 { font-family: var(--font-display); font-size: 21px; font-weight: 800; margin: 0; }
.auth-marca p { margin: 6px 0 0; color: var(--text-muted); font-size: 13.5px; }
.auth-marca p[hidden] { display: none; }

.auth-status { text-align: center; color: var(--text-muted); font-size: 14px; margin: 4px 0 8px; }
.auth-status[hidden] { display: none; }
.auth-status-erro { color: var(--q1); }

.auth-abas { margin-bottom: 18px; }
.auth-abas .tab-btn { flex: 1; justify-content: center; }
.auth-largo { width: 100%; justify-content: center; }
#form-auth .auth-largo { margin-top: 4px; }

.auth-msg { font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.auth-msg[hidden] { display: none; }
.auth-msg-erro { color: var(--q1); }
.auth-msg-ok { color: var(--accent); }

.auth-link {
  display: block; margin: 12px auto 0;
  background: none; border: 0; padding: 2px 4px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--accent); cursor: pointer;
}
.auth-link[hidden] { display: none; }
.auth-link:hover { text-decoration: underline; }

.auth-ou {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0; color: var(--text-muted); font-size: 12px;
}
.auth-ou::before, .auth-ou::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-google { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.auth-google:hover { border-color: var(--text-muted); }

.auth-rodape { text-align: center; font-size: 13px; color: var(--text-muted); margin: 22px 0 0; }
.auth-rodape a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-rodape a:hover { text-decoration: underline; }

/* ===========================================================
   Página de privacidade e termos
   =========================================================== */
.doc { max-width: 68ch; margin: 0 auto; padding: 28px 16px 48px; line-height: 1.6; font-size: 15px; }
.doc h1 { font-size: 26px; margin: 0 0 4px; line-height: 1.25; }
.doc h2 {
  font-size: 18px; margin: 40px 0 8px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.doc h3 { font-size: 15px; margin: 20px 0 6px; }
.doc p, .doc li { color: var(--text); }
.doc .doc-meta { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }
.doc a { color: var(--accent); }
.doc .doc-voltar { display: inline-block; margin-bottom: 18px; font-weight: 600; text-decoration: none; }
/* Barra de destaque é um pseudo-elemento reto, recortado pelo overflow:
   um border-left grosso somado ao border-radius curvava nas pontas e
   virava um "(" solto no tema escuro. */
.doc .doc-destaque {
  position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: var(--radius-lg);
  padding: 14px 18px 14px 22px; margin: 20px 0 8px;
}
.doc .doc-destaque::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
}
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 10px 0; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { color: var(--text-muted); font-weight: 600; font-size: 13px; }
body[data-armazenamento="local"] [data-modo="nuvem"],
body[data-armazenamento="nuvem"] [data-modo="local"] { display: none; }

/* WLB no celular: cada atividade vira um card com o total à vista */
@media (max-width: 760px) {
  .wlb-table { min-width: 0; }
  .wlb-table thead { display: none; }
  .wlb-table, .wlb-table tbody, .wlb-table tfoot, .wlb-table tr, .wlb-table td { display: block; }
  .wlb-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 6px;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
  }
  .wlb-table td { border: none; padding: 0; white-space: nowrap; }
  .wlb-table .col-titulo { flex: 1 1 auto; white-space: normal; }
  /* quebra de linha: título, total e editar em cima; dias embaixo */
  .wlb-table tbody tr::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .wlb-table .col-dia { order: 2; font-size: 12px; color: var(--text-muted); text-align: left; }
  .wlb-table .col-dia::before { content: attr(data-dia) " "; font-weight: 600; }
  .wlb-table .col-pct { color: var(--text-muted); font-size: 12.5px; }
  .wlb-table .col-vazia, .wlb-table .dia-vazio { display: none; }
  .wlb-table .wlb-total-row td { border-top: none; }
}

/* ===========================================================
   Faixa de modo demonstração
   =========================================================== */
.faixa-demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 24px;
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 11;
}
.faixa-demo[hidden] { display: none; }
.faixa-demo-acoes { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 760px) {
  .faixa-demo { padding: 8px 16px; }
}

/* ===========================================================
   Landing page (index.html) — visual próprio, fixo e vivo, de
   propósito diferente do app: a landing pode ousar (fundo escuro,
   cor saturada, movimento); o app do dia a dia continua pastel e
   calmo. Por isso usa hexadecimais próprios, não os tokens de tema
   claro/escuro do app — não é alternável, é um visual só.
   Contraste conferido (WCAG AA): texto do botão nas 4 cores de
   destaque, texto mudo sobre o fundo escuro.
   =========================================================== */
:root {
  --lp-bg: #0d1020;
  --lp-texto: #eef0fb;
  --lp-texto-mudo: #b9bee0;
  --lp-texto-mudo-2: #8b90b8;
  --lp-linha: #ffffff1f;
  --lp-superficie: #ffffff0d;
  --lp-accent: #22e0a0;      /* WLB — mesma família do teal do app */
  --lp-accent-rgb: 34, 224, 160;
  --lp-violeta: #9b82ff;     /* Projetos — clara o bastante pro texto escuro do botão */
  --lp-violeta-decor: #7c5cff; /* só decoração (esfera, ícone com texto branco) */
  --lp-coral: #ff6b5e;       /* Tarefas */
  --lp-ambar: #ffb020;       /* Metas */
}

@keyframes lp-drift-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(36px, -46px) scale(1.09); } }
@keyframes lp-drift-b { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-44px, 34px) scale(1.06); } }
@keyframes lp-drift-c { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(24px, 30px) scale(1.1); } }
@keyframes lp-fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lp-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes lp-ring-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--lp-accent-rgb), .55); }
  70% { box-shadow: 0 0 0 22px rgba(var(--lp-accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--lp-accent-rgb), 0); }
}
@keyframes lp-floaty { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(-2deg); } }

.lp-page {
  background:
    radial-gradient(ellipse 1200px 700px at 20% -10%, #241b45 0%, transparent 60%),
    radial-gradient(ellipse 1000px 800px at 100% 10%, #142a3a 0%, transparent 55%),
    var(--lp-bg);
  color: var(--lp-texto);
}

.lp-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto; padding: 22px 24px;
  position: relative; z-index: 5;
}
.lp-header .logo-dot { background: var(--lp-accent); box-shadow: 0 0 0 5px rgba(var(--lp-accent-rgb), .25); }
.lp-header h1 { font-size: 16px; }
.lp-header-nav { display: flex; align-items: center; gap: 10px; }
.lp-header-link {
  color: var(--lp-texto-mudo); font-size: 13.5px; font-weight: 600;
  padding: 8px 16px; border: 1px solid var(--lp-linha); border-radius: 999px;
  text-decoration: none; transition: border-color 0.15s ease, color 0.15s ease;
}
.lp-header-link:hover { color: var(--lp-texto); border-color: var(--lp-texto-mudo); }
.lp-header-link-entrar {
  color: #06140f; background: var(--lp-accent); border-color: var(--lp-accent);
}
.lp-header-link-entrar:hover { color: #06140f; filter: brightness(1.08); border-color: var(--lp-accent); }

.lp { max-width: 1180px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 3; }

.lp-hero {
  max-width: 900px; margin: 0 auto; padding: 40px 24px 56px; text-align: center;
  position: relative; overflow: hidden; /* contém as esferas decorativas — sem isso elas vazam e criam rolagem horizontal no celular */
}
.lp-orb { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.lp-orb-a { width: 420px; height: 420px; background: var(--lp-violeta-decor); top: -160px; left: -120px; opacity: .55; animation: lp-drift-a 18s ease-in-out infinite; }
.lp-orb-b { width: 360px; height: 360px; background: var(--lp-coral); top: -60px; right: -140px; opacity: .45; animation: lp-drift-b 22s ease-in-out infinite; }
.lp-orb-c { width: 300px; height: 300px; background: var(--lp-accent); bottom: -180px; left: 40%; opacity: .4; animation: lp-drift-c 26s ease-in-out infinite; }

.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px;
  background: var(--lp-superficie); border: 1px solid var(--lp-linha);
  font-size: 12.5px; font-weight: 600; color: var(--lp-texto-mudo);
  margin-bottom: 26px; animation: lp-fade-up .7s ease both; position: relative;
}
.lp-eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lp-accent); animation: lp-floaty 2.4s ease-in-out infinite; }

.lp-hero-titulo {
  font-size: 52px; line-height: 1.1; margin: 0 0 20px; position: relative;
}
.lp-hero-titulo span { display: block; animation: lp-fade-up .7s ease both; }
.lp-hero-titulo span:first-child { animation-delay: .05s; }
.lp-hero-titulo .lp-destaque {
  animation-delay: .18s;
  background: linear-gradient(100deg, var(--lp-accent), var(--lp-violeta-decor) 60%, var(--lp-coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lp-hero-sub {
  font-size: 17px; line-height: 1.6; color: var(--lp-texto-mudo); max-width: 56ch;
  margin: 0 auto 32px; position: relative; animation: lp-fade-up .5s ease .12s both;
}
.lp-hero-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; position: relative; animation: lp-fade-up .5s ease .2s both; }
.lp-hero-nota { font-size: 12.5px; color: var(--lp-texto-mudo-2); position: relative; animation: lp-fade-up .5s ease .26s both; }

.lp-btn-grande {
  padding: 15px 26px; font-size: 15px; border-radius: var(--radius-lg);
  transition: transform .2s ease, box-shadow .2s ease;
}
.lp-btn-primario {
  background: var(--lp-accent); color: #0d1020; border-color: var(--lp-accent); font-weight: 700;
  box-shadow: 0 10px 30px -6px rgba(var(--lp-accent-rgb), .55);
  animation: lp-ring-pulse 2.8s ease-in-out infinite;
}
.lp-btn-primario:hover { transform: translateY(-2px) scale(1.02); border-color: var(--lp-accent); }
.lp-btn-fantasma { background: var(--lp-superficie); border: 1px solid var(--lp-linha); color: var(--lp-texto); }

.lp-marquee-wrap {
  position: relative; z-index: 3; overflow: hidden;
  border-top: 1px solid var(--lp-linha); border-bottom: 1px solid var(--lp-linha);
  padding: 16px 0; background: var(--lp-superficie);
}
.lp-marquee-track { display: flex; width: max-content; gap: 40px; white-space: nowrap; animation: lp-marquee 22s linear infinite; }
.lp-marquee-wrap:hover .lp-marquee-track { animation-play-state: paused; }
.lp-marquee-item {
  display: flex; align-items: center; gap: 40px; font-family: var(--font-display);
  font-weight: 700; font-size: 15px; color: var(--lp-texto-mudo-2);
}
.lp-marquee-item b { font-weight: 700; }

.lp-secao { padding: 72px 0 40px; }
.lp-secao-titulo { text-align: center; font-size: 30px; margin: 0 0 12px; }
.lp-secao-sub { text-align: center; color: var(--lp-texto-mudo-2); max-width: 50ch; margin: 0 auto 40px; font-size: 14.5px; }
.lp-secao-estreita { max-width: 640px; margin: 0 auto; padding-top: 56px; }
.lp-secao-estreita .lp-secao-titulo { font-size: 22px; margin-bottom: 28px; }

.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.lp-card {
  padding: 24px; border-radius: 20px; background: var(--lp-superficie);
  border: 1px solid var(--lp-linha); border-top: 5px solid var(--card-cor, var(--lp-accent));
  transition: transform .25s ease;
}
.lp-card:hover { transform: translateY(-6px); }
.lp-card-icone {
  width: 46px; height: 46px; border-radius: 13px; background: var(--card-cor, var(--lp-accent));
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--card-cor, var(--lp-accent)) 60%, transparent);
}
.lp-card h3 { margin: 0 0 8px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.lp-card p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--lp-texto-mudo); }
.lp-card .badge-tool { background: color-mix(in srgb, var(--card-cor, var(--lp-accent)) 22%, transparent); color: var(--lp-texto); }

.lp-lista-honesta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.lp-lista-honesta li {
  display: flex; gap: 12px; padding: 16px 18px; border-radius: 14px;
  background: var(--lp-superficie); border: 1px solid var(--lp-linha);
  font-size: 14px; line-height: 1.55; color: var(--lp-texto);
}
.lp-lista-honesta li::before { content: "—"; color: var(--lp-accent); font-weight: 800; flex-shrink: 0; }

.lp-cta-final { text-align: center; padding: 64px 0 80px; }
.lp-cta-final .lp-secao-titulo { margin-bottom: 26px; }

.lp-footer {
  border-top: 1px solid var(--lp-linha); padding: 22px 24px; text-align: center;
  font-size: 12.5px; color: var(--lp-texto-mudo-2); position: relative; z-index: 3;
}
.lp-footer p { margin: 0 0 4px; }
.lp-footer a { color: var(--lp-accent); font-weight: 600; text-decoration: none; }
.lp-footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .lp-hero { padding: 32px 16px 40px; }
  .lp-hero-titulo { font-size: 32px; }
  .lp-secao { padding: 48px 0 32px; }
  .lp-secao-titulo { font-size: 24px; }
  .lp { padding: 0 16px; }
}

.lp-page :focus-visible { outline-color: var(--lp-accent); }
