/* DIN-30/11/2026 — Rotina mensal mais dinâmica: busca de cliente do CRM, vistas do calendário,
   prazos do Quadro junto e ícone de robô para o que o bot faz. Para tirar: apagar a linha em base.html. */

/* ---------- busca de cliente (estatico/cliente-busca.js) ---------- */
.cb-lista[popover] { position: fixed; inset: auto; margin: 0; }
.cb-lista { position: fixed; z-index: 2000; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
  border-radius: 12px; border: 1px solid rgba(140, 170, 215, .28); background: oklch(23% .03 258);
  color: var(--lq-tinta, #eaf1fa); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .65); font-size: .88rem; }
.cb-op { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.cb-op:hover { background: rgba(120, 165, 225, .14); }
.cb-op[aria-selected="true"] { background: var(--lq-azul, #2c6bb8); color: #fff; }
.cb-num { flex: none; min-width: 3.2em; font-variant-numeric: tabular-nums; font-weight: 700; opacity: .9; }
.cb-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-op mark { padding: 0; background: none; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.cb-vazio { padding: 8px 10px; font-size: .82rem; color: #c3cfdf; }   /* 4,5:1 ou mais no fundo da lista */
html[data-pilar-tema="claro"] .cb-lista { background: #fff; color: #142033; border-color: #c9d5e6; box-shadow: 0 18px 44px -16px rgba(20, 50, 90, .45); }
html[data-pilar-tema="claro"] .cb-op:hover { background: #eaf1fc; }
html[data-pilar-tema="claro"] .cb-op[aria-selected="true"] { background: #1452b8; color: #fff; }
html[data-pilar-tema="claro"] .cb-vazio { color: #4a5a70; }

/* ---------- ícone de robô (tarefa feita pelo bot) ---------- */
.bl-robo { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 17px; height: 17px;
  margin-right: 4px; border-radius: 5px; vertical-align: -3px; background: rgba(61, 139, 240, .22); color: #9cc3ff; }
.bl-robo svg { display: block; }
html[data-pilar-tema="claro"] .bl-robo { background: #dce8fb; color: #1452b8; }

/* ---------- barra de vistas e filtro ---------- */
.bl-cal-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin: 0 0 8px; }
.bl-cal-barra[hidden] { display: none; }
.bl-cal-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; border: 1px solid rgba(127, 127, 127, .25); }
.bl-cal-op { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.bl-cal-op:hover { background: rgba(120, 165, 225, .12); }
.bl-cal-op[aria-pressed="true"] { background: var(--lq-azul, #2c6bb8); color: #fff; }
.bl-cal-op[aria-pressed="true"] .bl-robo { background: rgba(255, 255, 255, .22); color: #fff; }
.bl-cal-op:focus-visible { outline: 2px solid var(--lq-azul-2, #2b78e4); outline-offset: 2px; }
.bl-cal-semnav { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; }
.bl-cal-semnav[hidden] { display: none; }
.bl-cal-resumo { text-align: center; font-size: .84rem; margin: 0 0 10px; color: var(--lq-tinta-2, #a9b8cc); }
.bl-cal-resumo .bl-robo { margin-right: 2px; }
.bl-cal-atras { color: #ff6b6b; }
html[data-pilar-tema="claro"] .bl-cal-op[aria-pressed="true"] { background: #1452b8; }
html[data-pilar-tema="claro"] .bl-cal-resumo { color: #3d4c63; }
html[data-pilar-tema="claro"] .bl-cal-atras { color: #b3261e; }

/* ---------- itens do dia ---------- */
.bl-cal-sd { display: none; }
.bl-cal-t { min-width: 0; }   /* item do dia não alarga a célula (grid: min-width auto) */
.bl-cal-t summary .bl-robo { margin-right: 3px; }
.bl-cal-p { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: .74rem; line-height: 1.3; padding: 3px 6px;
  border-radius: 6px; border-left: 3px solid #3d8bf0; background: rgba(150, 180, 225, .12); color: inherit; text-decoration: none; }
.bl-cal-p:hover, .bl-cal-p:focus-visible { background: rgba(61, 139, 240, .26); color: inherit; }
.bl-cal-p span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-cal-p .bl-robo { margin-right: 0; }
.bl-cal-p.bl-cq-urgente { border-left-color: #ff4d4d; background: rgba(255, 77, 77, .16); }
.bl-cal-p.bl-cq-alta { border-left-color: #f0a020; }
.bl-cal-p.bl-cq-feito { border-left-color: #22b366; }
.bl-cal-p.bl-cq-feito span { text-decoration: line-through; opacity: .75; }
.bl-cal-extra { display: grid; gap: 3px; }
.bl-cal-extra[hidden] { display: none; }
.bl-cal-extra summary { font-size: .72rem; font-weight: 600; padding: 0 6px; cursor: pointer; list-style: none; color: #7fb2ff; }
.bl-cal-extra summary::-webkit-details-marker { display: none; }
.bl-cal-leg { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: center; font-size: .76rem; margin: 10px 0 0; }
.bl-cal-leg span { display: inline-flex; align-items: center; gap: 6px; }
.bl-cal-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #3d8bf0; }
.bl-cal-leg i.bl-l-rotina { background: rgba(61, 139, 240, .35); border-left: 3px solid #3d8bf0; }
.bl-cal-leg i.bl-cq-urgente { background: #ff4d4d; } .bl-cal-leg i.bl-cq-alta { background: #f0a020; } .bl-cal-leg i.bl-cq-feito { background: #22b366; }
.bl-cal-vazia { text-align: center; margin: 14px 0 4px; font-size: .9rem; color: var(--lq-tinta-2, #a9b8cc); }
.bl-cal-vazia[hidden] { display: none; }
html[data-pilar-tema="claro"] .bl-cal-p { background: #eef2f8; }
html[data-pilar-tema="claro"] .bl-cal-p:hover { background: #dce8fb; }
html[data-pilar-tema="claro"] .bl-cal-p.bl-cq-urgente { background: #fde3e3; }
html[data-pilar-tema="claro"] .bl-cal-extra summary { color: #1452b8; }
html[data-pilar-tema="claro"] .bl-cal-vazia { color: #3d4c63; }

/* ---------- filtro: Rotina / Quadro / Do bot ---------- */
.bl-cal[data-filtro="rotina"] [data-fonte="quadro"],
.bl-cal[data-filtro="quadro"] [data-fonte="rotina"],
.bl-cal[data-filtro="bot"] [data-fonte]:not([data-bot]) { display: none; }

/* ---------- vista Semana: uma linha do mês, dias mais altos ---------- */
.bl-cal[data-vista="semana"] .bl-cal-grade > .bl-cal-sem:not(:first-child):not(.bl-cal-sem-atual) { display: none; }
.bl-cal[data-vista="semana"] .bl-cal-dia { min-height: 260px; }
.bl-cal[data-vista="semana"] .bl-cal-t summary, .bl-cal[data-vista="semana"] .bl-cal-p span { white-space: normal; }

/* ---------- vista Lista: só os dias com algo, um embaixo do outro ---------- */
.bl-cal[data-vista="lista"] .bl-cal-grade, .bl-cal[data-vista="lista"] .bl-cal-sem { display: block; }
.bl-cal[data-vista="lista"] .bl-cal-dia { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: start;
  gap: 0 12px; min-height: 0; margin-bottom: 6px; padding: 9px 12px; }
.bl-cal[data-vista="lista"] .bl-cal-dia > :not(.bl-cal-n) { grid-column: 2; margin-bottom: 4px; }
.bl-cal[data-vista="lista"] .bl-cal-n { grid-column: 1; grid-row: 1 / span 30; font-size: 1rem; gap: 6px; display: flex; align-items: baseline; }
.bl-cal[data-vista="lista"] .bl-cal-sd { display: inline; font-size: .74rem; text-transform: uppercase; }
.bl-cal[data-vista="lista"] .bl-cal-t summary, .bl-cal[data-vista="lista"] .bl-cal-p { font-size: .86rem; }
.bl-cal[data-vista="lista"] .bl-cal-t summary, .bl-cal[data-vista="lista"] .bl-cal-p span { white-space: normal; }
.bl-cal[data-vista="lista"] .bl-cal-mais { position: static; order: 99; justify-self: start; opacity: .8; transform: none; }
.bl-cal[data-vista="lista"] .bl-cal-extra { grid-column: 2; }
.bl-cal[data-vista="lista"] .bl-cal-sem:first-child,
.bl-cal[data-vista="lista"] .bl-cal-fora,
.bl-cal[data-vista="lista"] .bl-cal-vazio { display: none; }   /* depois da regra do dia: mesma força, a última vale */

@media (max-width: 700px) {
  .bl-cal-seg { flex: 1 1 100%; } .bl-cal-op { flex: 1 1 auto; justify-content: center; padding: 0 6px; font-size: .8rem; }
  .bl-cal-op .bl-robo { margin-right: 3px; }
  .bl-cal[data-vista="lista"] .bl-cal-dia { grid-template-columns: 4.2rem minmax(0, 1fr); }
  .bl-cal-sd { display: inline; font-size: .72rem; text-transform: uppercase; margin-right: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .bl-cal-op { transition: background-color .15s ease, color .15s ease; }
  .bl-cal-p { transition: background-color .15s ease; }
}

/* ================= TAREFAS-DIA-30/11/2026 — aba "Tarefas do dia" (Cartões, Lista, Kanban, Calendário) =================
   Isaac: arrastar os cards para outro dia, calendário mais longo e uma aba só com filtros e várias visões.
   Cores fixas: vermelho = urgente, âmbar = prioridade alta, azul = no prazo, verde = feito. */

/* ---------- barra de visões e filtros (modelos_html/_tarefas_barra.html) ---------- */
.td-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 0 0 10px; }
.td-grupo { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 11px; border: 1px solid rgba(127, 127, 127, .25); }
.td-op { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 8px;
  font-size: .86rem; font-weight: 600; color: inherit; text-decoration: none; }
.td-op:hover { background: rgba(120, 165, 225, .12); color: inherit; }
.td-op[aria-current] { background: var(--lq-azul, #2c6bb8); color: #fff; }
.td-op:focus-visible { outline: 2px solid var(--lq-azul-2, #2b78e4); outline-offset: 2px; }
.td-n { display: inline-block; min-width: 1.5em; padding: 0 5px; border-radius: 999px; font-size: .74rem; line-height: 1.5;
  text-align: center; background: rgba(127, 127, 127, .22); font-variant-numeric: tabular-nums; }
.td-op[aria-current] .td-n { background: rgba(255, 255, 255, .25); }
.td-nota { margin: -4px 0 10px; font-size: .82rem; color: var(--lq-tinta-2, #a9b8cc); }
html[data-pilar-tema="claro"] .td-op[aria-current] { background: #1452b8; }
html[data-pilar-tema="claro"] .td-nota { color: #3d4c63; }

/* ---------- Cartões e Lista (modelos_html/_tarefas_dia.html) ---------- */
.td-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.td-resumo { margin: 0; font-size: .92rem; }
.td-novos { display: flex; gap: 8px; }
.td-vazio { text-align: center; padding: 28px 10px; color: var(--lq-tinta-2, #a9b8cc); }
.td-sec { margin: 0 0 18px; }
.td-sec h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.td-g-atrasadas h2 { color: #ff6b6b; }
html[data-pilar-tema="claro"] .td-g-atrasadas h2 { color: #b3261e; }
.td-cartoes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.td-cartao { display: grid; align-content: start; gap: 5px; padding: 10px 12px; border-radius: 12px; min-width: 0;
  border: 1px solid rgba(127, 127, 127, .22); border-left: 4px solid #3d8bf0; background: var(--lq-vidro, rgba(255, 255, 255, .04)); }
.td-e-urgente.td-cartao { border-left-color: #ff4d4d; }
.td-e-alta.td-cartao { border-left-color: #f0a020; }
.td-e-feito.td-cartao { border-left-color: #22b366; opacity: .75; }
.td-c-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .74rem; }
.td-tipo { font-weight: 700; text-transform: uppercase; letter-spacing: .02em; opacity: .8; }
.td-estado { margin-left: auto; font-weight: 600; }
.td-e-urgente .td-estado { color: #ff6b6b; } .td-e-alta .td-estado { color: #f5b544; } .td-e-feito .td-estado { color: #3ccf7f; }
html[data-pilar-tema="claro"] .td-e-urgente .td-estado { color: #b3261e; }
html[data-pilar-tema="claro"] .td-e-alta .td-estado { color: #8a5300; }
html[data-pilar-tema="claro"] .td-e-feito .td-estado { color: #17733f; }
.td-c-titulo { font-weight: 700; font-size: .95rem; line-height: 1.3; color: inherit; overflow-wrap: anywhere; }
.td-c-titulo:hover { text-decoration: underline; color: inherit; }
.td-c-cli, .td-c-det { margin: 0; font-size: .82rem; overflow-wrap: anywhere; }
.td-c-det { color: var(--lq-tinta-2, #a9b8cc); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
html[data-pilar-tema="claro"] .td-c-det { color: #3d4c63; }
.td-c-pe { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 2px 0 0; font-size: .76rem; opacity: .85; }
.td-selo { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: .7rem; font-weight: 700; line-height: 1.6;
  background: rgba(127, 127, 127, .22); }
.td-selo-auto { background: rgba(148, 102, 255, .22); color: #c9b5ff; }
.td-selo-meu { background: rgba(61, 139, 240, .22); color: #9cc3ff; }
html[data-pilar-tema="claro"] .td-selo-auto { background: #ece4ff; color: #5a2fc2; }
html[data-pilar-tema="claro"] .td-selo-meu { background: #dce8fb; color: #1452b8; }
.td-tabela-wrap { overflow-x: auto; }
.td-tabela { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .86rem; table-layout: fixed; }
/* mesmas colunas em todos os grupos (Hoje, Sem data...) */
.td-tabela th:nth-child(1) { width: 4.5rem; } .td-tabela th:nth-child(2) { width: 36%; }
.td-tabela th:nth-child(3) { width: 22%; } .td-tabela th:nth-child(5) { width: 7.5rem; }
.td-tabela td { overflow-wrap: anywhere; }
.td-tabela th { text-align: left; font-size: .74rem; text-transform: uppercase; opacity: .75; padding: 4px 8px; }
.td-tabela td { padding: 7px 8px; border-top: 1px solid rgba(127, 127, 127, .18); vertical-align: top; }
.td-tabela tr { box-shadow: inset 4px 0 0 #3d8bf0; }
.td-tabela tr.td-e-urgente { box-shadow: inset 4px 0 0 #ff4d4d; } .td-tabela tr.td-e-alta { box-shadow: inset 4px 0 0 #f0a020; }
.td-tabela tr.td-e-feito { box-shadow: inset 4px 0 0 #22b366; opacity: .75; }
.td-tabela thead tr { box-shadow: none; }
.td-tabela a { color: inherit; font-weight: 600; }
.td-data { white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-leg { margin-top: 4px; }

/* ---------- entregas de hoje: "Enviar pelo bot" ---------- */
.bl-entrega-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.bl-entrega-acoes form { margin: 0; }
.bl-entrega-ajuda { display: block; font-size: .76rem; opacity: .85; }

/* ---------- calendário mais longo: o dia cresce e mostra tudo ---------- */
.bl-cal[data-vista="mes"] .bl-cal-dia { min-height: 136px; }
.bl-cal-dica { opacity: .85; }
.bl-cal-mover { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; margin: 2px 0; }
.bl-cal-mover label { display: grid; gap: 2px; font-size: .74rem; }
.bl-cal-mover input { width: 4.5rem; }
.bl-cal-mover select { width: auto; }

/* ---------- arrastar para outro dia (estatico/tarefas-arrastar.js) ---------- */
.bl-cal [data-arrastar] { cursor: grab; -webkit-touch-callout: none; }
.bl-cal [data-arrastar] summary { cursor: grab; }
.bl-cal-arrastando, .bl-cal-arrastando * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.bl-cal-origem { opacity: .35; }
.bl-cal-alvo { outline: 2px dashed var(--lq-azul-2, #2b78e4); outline-offset: -2px; background: rgba(61, 139, 240, .12); }
.bl-cal-fantasma { position: fixed; z-index: 3000; pointer-events: none; max-width: 240px; padding: 4px 8px; border-radius: 8px;
  font-size: .78rem; font-weight: 600; background: var(--lq-azul, #2c6bb8); color: #fff; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translate(-50%, -130%); }
.bl-cal-movendo { opacity: .5; pointer-events: none; }
.bl-cal.bl-cal-em-arrasto[data-vista="lista"] .bl-cal-dia.bl-cal-vazio:not(.bl-cal-fora) { display: grid; min-height: 40px; }
.bl-cal-mover input, .bl-cal-mover select, .bl-cal-mover .btn { min-height: 0; height: 30px; padding-top: 2px; padding-bottom: 2px; }
.td-dlg-mover p { margin: 0 0 10px; }
.td-dlg-mover footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 700px) {
  .td-barra { justify-content: stretch; } .td-grupo { flex: 1 1 100%; } .td-op { flex: 1 1 auto; justify-content: center; padding: 0 6px; font-size: .8rem; }
  .td-cartoes { grid-template-columns: 1fr; }
  .bl-cal[data-vista="mes"] .bl-cal-dia { min-height: 0; }
}

/* TD-JANELA-30/11/2026 — seções que recolhem (HOJE ▸ / SEM DATA ▸) e a janela da tarefa na própria tela */
.td-recolher { display: inline-flex; align-items: center; gap: 8px; padding: 2px 6px 2px 2px; margin-left: -2px;
  border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.td-recolher:hover { background: rgba(127, 127, 127, .12); }
.td-recolher:focus-visible { outline: 2px solid var(--tblr-primary, #206bc4); outline-offset: 2px; }
.td-seta { width: .55em; height: .55em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin: 0 4px 3px 4px; transition: transform .15s ease; opacity: .7; }
.td-recolher[aria-expanded="false"] .td-seta { transform: rotate(-45deg); margin-bottom: 0; }
.td-fechada { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .td-seta { transition: none; } }
.td-janela { width: min(560px, calc(100vw - 24px)); overflow-y: auto; }
.td-janela .td-j-info { margin: 0 0 10px; color: var(--tblr-secondary, #667382); font-size: .85rem; }
.td-janela .td-j-det { white-space: pre-wrap; margin: 0 0 12px; }
.td-janela .td-j-pedido { margin: 0 0 10px; }
.td-janela .td-j-pe { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin-top: 4px; }
.td-janela .td-j-pe .btn { white-space: nowrap; }
.td-janela .td-j-esp { flex: 1; }
.td-janela .td-j-blocos { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.td-janela .td-j-mover { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.td-janela .td-j-mover label { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; }
.td-janela .td-j-mover input { width: 6rem; }
.td-janela [data-td-parte] { padding: 0 16px 14px; }
