/* Calendarq · tela "agenda" (frente F3). Carregado depois do legado: sobrescreva aqui.
   Só tokens var(--…), nunca cor escrita à mão (o verificar.mjs recusa). Classes com prefixo próprio da tela (cqag-). */

.cqag { display: flex; flex-direction: column; gap: 16px; padding-top: 28px; padding-bottom: 56px; }

/* ---------- Título e botão ---------- */
.cqag-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cqag-kick { display: block; margin-bottom: 6px; }
.cqag-h2 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -.04em; line-height: 1.02; color: var(--ink); }
.cqag-h2 .acc { font-size: 1.08em; letter-spacing: -.02em; }
.cqag-bar-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cqag-resumo { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Mês, setas, ano, vista ---------- */
.cqag-nav { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.cqag-titulo { margin: 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -.04em; color: var(--ink); white-space: nowrap; }
.cqag-titulo .acc { font-size: 1.08em; }
.cqag-sp { flex: 1; }

.cqag-chips { display: inline-flex; gap: 3px; padding: 4px; border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cqag-chips::-webkit-scrollbar { display: none; }
.cqag-chip {
  flex: none; height: 30px; padding: 0 12px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.cqag-chip:hover { color: var(--ink); }
.cqag-chip.on { background: var(--pri-bg); color: var(--pri-ink); box-shadow: var(--pri-sh); }
.cqag-chips.light .cqag-chip.on { background: var(--g3); color: var(--ink); box-shadow: var(--g-hl), var(--g-sh); }
.cqag-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.cqag-filtro { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cqag-filtro .cqag-chips { min-width: 0; }
.cqag-mais-proj {
  position: relative; flex: none; height: 38px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3); cursor: pointer;
}
.cqag-mais-proj select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* ---------- O mês ---------- */
.cqag-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: var(--r-lg); overflow: hidden; }
.cqag-dow {
  padding: 10px 10px 8px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--g-edge-low);
}
.cqag-day {
  position: relative; min-width: 0; min-height: 112px; padding: 7px 7px 8px; display: flex; flex-direction: column; gap: 3px;
  border-right: 1px solid var(--g-edge-low); border-bottom: 1px solid var(--g-edge-low); cursor: pointer; outline: none;
  transition: background .3s var(--ease);
}
.cqag-day:nth-child(7n) { border-right: 0; }
.cqag-day:nth-last-child(-n+7) { border-bottom: 0; }
.cqag-day:hover { background: var(--g1); }
.cqag-day:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.cqag-n {
  width: 24px; height: 24px; margin-bottom: 2px; display: grid; place-items: center; border-radius: 50%;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink);
}
.cqag-day.wk .cqag-n, .cqag-col.wk .cqag-n { color: var(--ink-3); }
.cqag-day.mute { color: var(--ink-4); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.cqag-day.mute .cqag-n { color: var(--ink-4); }
.cqag-day.today, .cqag-col.today { background: var(--g1); }
.cqag-day.today .cqag-n, .cqag-col.today .cqag-n { background: var(--pri-bg); color: var(--pri-ink); }
.cqag-day.sel:not(.today) .cqag-n, .cqag-col.sel:not(.today) .cqag-n { box-shadow: inset 0 0 0 1.5px var(--ink-3); }

.cqag-add {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px;
  color: var(--ink-3); font-size: 16px; opacity: 0; transition: opacity .25s var(--ease), color .25s var(--ease);
}
.cqag-day:hover .cqag-add, .cqag-day:focus-within .cqag-add, .cqag-add:focus-visible { opacity: 1; }
.cqag-add:hover { color: var(--ink); }
.cqag-add.is-fixo { position: static; opacity: 1; margin-left: auto; }
@media (hover: none) { .cqag-day .cqag-add { display: none; } }

/* ---------- O que mora no dia (cor por tipo) ---------- */
.cqag-ev {
  display: block; width: 100%; padding: 3px 6px; border-radius: 6px; font-size: 10.5px; line-height: 1.3; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--sunk); color: var(--ink-2);
  transition: filter .25s var(--ease);
}
.cqag-ev::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 5px 1px 0; border-radius: 50%; vertical-align: middle; background: var(--ink-3); }
.cqag-ev:hover { filter: brightness(.96); }
.cqag-ev:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cqag-h { margin-right: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cqag-ev.t-prazo { background: var(--warn-s); color: var(--warn); }
.cqag-ev.t-prazo::before { background: var(--warn); }
.cqag-ev.t-visita { background: var(--ok-s); color: var(--ok); }
.cqag-ev.t-visita::before { background: var(--ok); }
.cqag-ev.t-reuniao { background: var(--info-s); color: var(--info); }
.cqag-ev.t-reuniao::before { background: var(--info); }
.cqag-ev.t-financeiro { background: var(--pri-bg); color: var(--pri-ink); }
.cqag-ev.t-financeiro::before { background: var(--pri-ink); }
.cqag-ev.t-marco { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-3); }
.cqag-ev.t-marco::before { background: var(--ink-4); }
/* Do escritório, sem cliente (49): contorno, letra inclinada. */
.cqag-ev.is-own { background: transparent; box-shadow: inset 0 0 0 1px var(--line-3); font-style: italic; }
.cqag-ev.is-done { opacity: .55; text-decoration: line-through; }
.cqag-mais { align-self: flex-start; padding: 1px 6px; font-size: 10.5px; color: var(--ink-3); }
.cqag-mais:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- A semana ---------- */
.cqag-sem { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: var(--r-lg); overflow: hidden; }
.cqag-col { min-width: 0; min-height: 360px; display: flex; flex-direction: column; border-right: 1px solid var(--g-edge-low); }
.cqag-col:last-child { border-right: 0; }
.cqag-col-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; border-bottom: 1px solid var(--g-edge-low); }
.cqag-col-w { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.cqag-col-h .cqag-n { margin: 0; cursor: pointer; }
.cqag-col-b { display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.cqag-ev.is-long { white-space: normal; padding: 6px 8px; font-size: 12px; }
.cqag-ev.is-long .cqag-t { display: inline; }
.cqag-p { display: block; margin-top: 2px; font-size: 10.5px; opacity: .75; }
.cqag-vazio { font-size: 12px; color: var(--ink-4); }

/* ---------- Legenda ---------- */
.cqag-legenda { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--ink-3); }
.cqag-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.cqag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--ink-4); flex: none; }
.cqag-dot.t-prazo { background: var(--warn); }
.cqag-dot.t-visita { background: var(--ok); }
.cqag-dot.t-reuniao { background: var(--info); }
.cqag-dot.t-tarefa { background: var(--ink-3); }
.cqag-dot.t-financeiro { background: var(--ink); }
.cqag-dot.t-marco { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.cqag-dot.is-own { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); border-radius: 50%; }

/* ---------- Animação do mês e da semana ---------- */
.cqag-cal.slide-next .cqag-day, .cqag-sem.slide-next .cqag-col { animation: cqagNext .45s var(--ease); }
.cqag-cal.slide-prev .cqag-day, .cqag-sem.slide-prev .cqag-col { animation: cqagPrev .45s var(--ease); }
@keyframes cqagNext { from { opacity: 0; transform: translateX(14px); } }
@keyframes cqagPrev { from { opacity: 0; transform: translateX(-14px); } }
@media (prefers-reduced-motion: reduce) {
  .cqag-cal .cqag-day, .cqag-sem .cqag-col { animation: none !important; }
}

/* ---------- Janela do dia ---------- */
.cqag-dia-lista { display: flex; flex-direction: column; gap: 6px; }

/* ---------- A lista do celular ---------- */
.cqag-lista { display: flex; flex-direction: column; gap: 18px; }
.cqag-grupo { display: flex; flex-direction: column; gap: 8px; }
.cqag-grupo-h { display: flex; align-items: baseline; gap: 10px; }
.cqag-grupo-d { font-size: 12px; color: var(--ink-3); }
.cqag-lin-box { border-radius: var(--r-md); overflow: hidden; }
.cqag-lin {
  display: grid; grid-template-columns: 54px auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--g-edge-low); color: var(--ink);
}
.cqag-lin:last-child { border-bottom: 0; }
.cqag-lin.is-own .cqag-info strong { font-style: italic; }
.cqag-lead { display: grid; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); }
.cqag-lead small { font-size: 10.5px; color: var(--ink-4); }
.cqag-info { display: grid; min-width: 0; }
.cqag-info strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.cqag-info small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cqag-lin .chev { color: var(--ink-4); }
.cqag-mais-btn { align-self: flex-start; }

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  .cqag { gap: 12px; padding-top: 16px; padding-bottom: 96px; }
  .cqag-h2 { font-size: 28px; }
  .cqag-resumo { display: none; }
  .cqag-titulo { font-size: 20px; margin: 0; }
  .cqag-filtro { overflow-x: auto; scrollbar-width: none; }
  .cqag-filtro::-webkit-scrollbar { display: none; }
  .cqag-dow { padding: 8px 0; text-align: center; font-size: 11px; letter-spacing: .04em; }
  .cqag-day { min-height: 56px; padding: 6px 2px; align-items: center; }
  .cqag-dots { display: flex; justify-content: center; gap: 3px; margin-top: 4px; }
  .cqag-dots .cqag-dot { width: 5px; height: 5px; border-radius: 50%; }
  /* A semana vira uma pilha de dias. */
  .cqag-sem { grid-template-columns: 1fr; }
  .cqag-col { min-height: 0; border-right: 0; border-bottom: 1px solid var(--g-edge-low); }
  .cqag-col:last-child { border-bottom: 0; }
  .cqag-col-b { padding: 4px 10px 10px; }
}
@media (min-width: 721px) { .cqag-dots { display: none; } }
