/* Agenda (espelho do Vector): visão do dia por profissional e visão da semana */
.ag-acoes { align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-nav { display: inline-flex; align-items: center; gap: 6px; }
.ag-nav input[type=date] { height: 36px; width: 150px; }
.ag-nav .icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-2); }
.ag-nav .icon-btn:hover { border-color: var(--ink-4); color: var(--ink); }
.ag-nav .icon-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.ag-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.ag-seg button { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.ag-seg button + button { border-left: 1px solid var(--line); }
.ag-seg button.on { background: var(--green); color: #fff; }

.ag-status { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.ag-st { display: inline-flex; align-items: center; gap: 6px; }
.ag-st svg { width: 14px; height: 14px; }
.ag-st-ok svg { color: var(--green); }
.ag-st-alerta { color: var(--amber); }

.ag-profs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 4px 12px; }
.ag-profs:empty { display: none; }
.ag-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--ink-2); }
.ag-chip b { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.ag-chip.on { border-color: var(--green); background: var(--green-50); color: var(--green); }
.ag-chip.on b { color: var(--green); }
.ag-chip-fora { margin-left: auto; border-style: dashed; }
.ag-chip-fora.on { border-style: solid; border-color: var(--ink-4); background: #fff; color: var(--ink-2); }
.ag-vazio { padding: 40px 20px; text-align: center; color: var(--ink-3); }

/* cores por situação (borda à esquerda do cartão) */
.sit-agendado { --sit: var(--ink-4); }
.sit-confirmado { --sit: var(--green); }
.sit-chegou { --sit: #2f6fb0; }
.sit-em_atendimento { --sit: #7a4fb5; }
.sit-atendido { --sit: var(--green-900); }
.sit-faltou { --sit: var(--red); }
.sit-cancelado, .sit-desmarcado, .sit-removido { --sit: var(--ink-4); }
.sit-remarcado { --sit: var(--amber); }
.sit-outro { --sit: var(--ink-3); }

/* dia */
.ag-grade { padding: 0 0 12px; overflow: hidden; }
.ag-titulo { padding: 14px 20px 10px; font-weight: 600; font-size: 14px; }
.ag-titulo::first-letter, .ag-dia-h::first-letter { text-transform: uppercase; }
.ag-grade-in { display: flex; overflow-x: auto; padding: 0 12px 0 0; }
.ag-regua { position: relative; flex: none; width: 56px; margin-top: 46px; }
.ag-regua span { position: absolute; right: 8px; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.ag-cols { flex: 1; display: grid; gap: 6px; min-width: 0; }
.ag-col { min-width: 0; }
.ag-col-h { height: 46px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 10px; border-top: 3px solid var(--cor); border-radius: 6px 6px 0 0;
  background: color-mix(in srgb, var(--cor) 9%, #fff); white-space: nowrap; overflow: hidden; }
.ag-col-h b { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--cor) 70%, #000); overflow: hidden; text-overflow: ellipsis; }
.ag-col-h span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.ag-col-b { position: relative; background: #fcfdfc; }
.ag-col-b > i { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.ag-col-b > i.meia { border-top: 1px dashed var(--line-2); }
.ag-agora { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 2; }
.ag-card { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 3px 8px 3px 9px; overflow: hidden; text-align: left;
  border: 1px solid var(--line); border-left: 3px solid var(--sit); border-radius: 7px; background: #fff; font-size: 12px; line-height: 1.3; z-index: 1; }
.ag-card:hover { border-color: var(--ink-4); border-left-color: var(--sit); z-index: 3; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ag-card > * { flex: none; }
.ag-h { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ag-h span { color: var(--ink-4); }
.ag-pac { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-proc { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-sit { margin-left: auto; font-family: var(--sans, inherit); font-style: normal; font-size: 11px; font-weight: 600; color: var(--sit); overflow: hidden; text-overflow: ellipsis; }
.sit-cancelado .ag-pac, .sit-desmarcado .ag-pac, .sit-removido .ag-pac { text-decoration: line-through; color: var(--ink-3); }
.ag-card.curto { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.ag-card.curto .ag-h { flex: none; }
.ag-card.curto .ag-h > span, .ag-card.curto .ag-proc { display: none; }
.ag-card.curto .ag-pac { flex: 1; min-width: 0; }
.ag-card.curto .ag-sit { display: none; }
.ag-movel { display: none; }

/* semana */
.ag-semana { display: grid; grid-template-columns: repeat(var(--n), minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.ag-dia { padding: 0 0 8px; min-width: 0; }
.ag-dia.hoje { border-color: var(--green); }
.ag-dia-h { display: flex; justify-content: space-between; width: 100%; padding: 12px 12px 8px; font-weight: 600; font-size: 13px; }
.ag-dia-h span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.ag-dia-h:hover { color: var(--green); }
.ag-linha { display: flex; flex-direction: column; gap: 1px; width: calc(100% - 16px); margin: 0 8px 6px; padding: 6px 8px; text-align: left;
  border: 1px solid var(--line-2); border-left: 3px solid var(--sit); border-radius: 7px; background: #fff; font-size: 12.5px; }
.ag-linha:hover { border-color: var(--line); border-left-color: var(--sit); background: #fcfdfc; }
.ag-linha b { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.ag-linha span { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-linha small { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-nada { margin: 4px 12px 8px; font-size: 12px; color: var(--ink-4); }

/* detalhe e importação */
.ag-det { margin: 0; display: grid; gap: 10px; }
.ag-det-l { display: grid; grid-template-columns: 130px 1fr; gap: 12px; font-size: 13.5px; }
.ag-det dt { color: var(--ink-3); font-size: 12.5px; }
.ag-det dd { margin: 0; }
.ag-det small { color: var(--ink-3); }
.ag-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--sit); color: var(--sit); font-size: 12px; font-weight: 600; }
.ag-res { margin-top: 14px; padding: 12px 14px; border-radius: 9px; background: var(--green-50); font-size: 13px; }
.ag-res p { margin: 0 0 6px; }
.ag-res ul { margin: 0 0 6px; padding-left: 18px; line-height: 1.7; }

@media (max-width: 760px) {
  #viewAgenda .head-actions.ag-acoes { width: 100%; flex-wrap: wrap; overflow: visible; }
  .ag-nav { flex: 1 1 100%; }
  .ag-nav input[type=date] { flex: 1; width: auto; min-width: 0; }
  .ag-seg { flex: 1 1 auto; }
  .ag-seg button { flex: 1; }
  #agImportar { flex: 1 1 auto; justify-content: center; }
  .ag-grade { display: none; }
  .ag-movel { display: flex; flex-direction: column; gap: 12px; }
  .ag-lista { padding-bottom: 8px; }
  .ag-lista .ag-card { position: static; width: calc(100% - 24px); margin: 0 12px 8px; }
  .ag-semana { grid-template-columns: 1fr; }
}
