/* Agenda clínica — calendário operacional fluido e integrado ao shell. */

#view-agenda [hidden],
#modalNovoAgendamento [hidden] { display: none !important; }

.agenda-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Missão Especial 12: semana operacional sempre visível e resumo informativo. */
.agenda-metricas{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 14px}
.agenda-metricas article{display:flex;min-height:72px;align-items:center;gap:12px;padding:14px 16px;border:1px solid var(--acs-surface-border,rgba(32,54,77,.18));border-radius:14px;background:var(--acs-surface-soft,#d1e5f6)}
.agenda-metricas strong{color:#0d2a45;font-size:24px}.agenda-metricas span{color:#536a80;font-size:12px}.agenda-instrucao{color:var(--text-muted);font-size:11.5px}
@media(max-width:760px){.agenda-metricas{grid-template-columns:repeat(2,minmax(0,1fr))}}

.agenda-abas{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  margin:0 0 10px;
  padding:5px;
  border:1px solid rgba(32,54,77,.18);
  border-radius:12px;
  background:rgba(222,238,249,.7);
  overflow-x:auto;
  scrollbar-width:none;
}
.agenda-abas::-webkit-scrollbar{display:none}
.agenda-abas button{
  flex:0 0 auto;
  min-height:38px;
  padding:7px 15px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:#456079;
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
  cursor:pointer;
  transition:background-color 150ms ease,color 150ms ease,box-shadow 150ms ease;
}
.agenda-abas button:hover{background:#c5def3;color:#20364d}
.agenda-abas button.ativa{
  background:#9cc7ea;
  color:#20364d;
  box-shadow:0 1px 4px rgba(20,66,112,.12);
}

.agenda-confirmacoes>header,.agenda-espera-integrada>header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;padding:13px 16px;border-radius:15px;background:#c4def3;color:#0b2d49}
.agenda-confirmacoes>header div,.agenda-espera-integrada>header div{display:grid;gap:3px}.agenda-confirmacoes>header span,.agenda-espera-integrada>header span{color:#49677f;font-size:12px;font-weight:500}
.agenda-kanban{display:grid;grid-template-columns:repeat(6,minmax(190px,1fr));gap:10px;overflow-x:auto;padding:1px 1px 10px}
.agenda-kanban-coluna{min-height:340px;padding:10px;border:1px solid rgba(55,91,121,.18);border-radius:15px;background:rgba(216,234,248,.76)}
.agenda-kanban-coluna>h3{display:flex;justify-content:space-between;margin:0 0 10px;color:#163a57;font-size:12px}.agenda-kanban-coluna>h3 span{display:grid;min-width:22px;height:22px;place-items:center;border-radius:999px;background:#edf7ff;color:#285979}
.agenda-confirmacao-card{display:grid;gap:5px;margin-bottom:8px;padding:11px;border:1px solid rgba(67,102,130,.16);border-radius:12px;background:#edf7ff;box-shadow:0 4px 14px rgba(18,58,89,.06);cursor:grab}
.agenda-confirmacao-card>span,.agenda-confirmacao-card small{color:#557188;font-size:11px}.agenda-confirmacao-card p{margin:2px 0;color:#294a63;font-size:11.5px;line-height:1.45}.agenda-confirmacao-card select{width:100%;padding:6px;border:1px solid rgba(55,91,121,.22);border-radius:8px;background:#fff;color:#17364e;font-size:11px}
.agenda-kanban-vazio{padding:18px 4px;color:#6d8497;font-size:11px;text-align:center}
.agenda-tabela-scroll{overflow:auto;border-radius:15px}.agenda-espera-integrada table{width:100%;border-collapse:collapse;background:rgba(232,244,252,.82)}.agenda-espera-integrada th,.agenda-espera-integrada td{padding:12px;border-bottom:1px solid rgba(55,91,121,.14);color:#23455f;font-size:12px;text-align:left}.agenda-espera-integrada th{background:#bddbf1;color:#0c3351;font-size:10.5px;text-transform:uppercase}
.agenda-tabela-scroll tbody tr:nth-child(odd){background:rgba(239,248,254,.56)}
.agenda-tabela-scroll tbody tr:nth-child(even){background:rgba(210,231,246,.52)}
.agenda-tabela-scroll tbody tr:hover{background:rgba(184,218,242,.72)}

.agenda-app {
  --agenda-linha: rgba(100, 116, 139, .14);
  --agenda-slot-altura: 52px;
  --agenda-azul-controle: rgba(159, 203, 238, .82);
  --agenda-azul-controle-hover: rgba(145, 194, 232, .94);
  --agenda-azul-painel: rgba(196, 222, 243, .88);
  --agenda-azul-suave: rgba(216, 235, 248, .76);
  min-width: 0;
}

.agenda-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.agenda-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--primary, #0284c7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.agenda-toolbar h2 {
  margin: 0;
  color: var(--secondary);
  font-size: clamp(24px, 2.2vw, 32px);
  letter-spacing: -.04em;
}

.agenda-toolbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.agenda-toolbar-acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.agenda-workspace {
  display: block;
  min-height: 620px;
}

.agenda-equipe {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: -5px 0 14px;
  padding: 0;
}

.agenda-equipe-head {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  padding: 0;
  color: var(--secondary);
}

.agenda-equipe-head strong { font-size: 13px; }

.agenda-equipe-head span {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(14, 165, 233, .12);
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
}

.agenda-equipe-opcoes,
#agendaProfissionaisLista {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.agenda-equipe-opcoes {
  overflow-x: auto;
  padding: 2px 3px 4px;
  scrollbar-width: thin;
}

.agenda-profissional {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  width: auto;
  padding: 7px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.agenda-profissional:hover { background: rgba(255, 255, 255, .46); }
.agenda-profissional:active { transform: translateY(1px); }
.agenda-profissional.ativo { background: rgba(219, 234, 254, .64); color: #075985; }

.agenda-profissional > span { display: flex; min-width: 0; align-items: baseline; gap: 5px; }

.agenda-profissional strong,
.agenda-profissional small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-profissional strong { font-size: 11.5px; }
.agenda-profissional small { color: var(--text-muted); font-size: 9px; }
.agenda-profissional b { color: var(--text-muted); font-size: 10px; }

.agenda-cor {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--prof-cor, #0ea5e9);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--prof-cor, #0ea5e9) 18%, transparent);
}

.agenda-cor-todos {
  background: conic-gradient(#0ea5e9, #8b5cf6, #ec4899, #f59e0b, #0ea5e9);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12);
}

.agenda-principal { min-width: 0; }

.agenda-controles {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(74, 122, 158, .18);
  border-radius: 22px;
  background: rgba(219, 237, 250, .48);
}

.agenda-navegacao,
.agenda-controles-direita,
.agenda-visoes {
  display: flex;
  align-items: center;
  gap: 5px;
}

.agenda-nav-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(56, 122, 167, .42);
  border-radius: 50%;
  background: var(--agenda-azul-controle);
  box-shadow: 0 5px 14px rgba(30, 92, 133, .13), inset 0 1px 0 rgba(255, 255, 255, .58);
  color: #0b3b5b;
  font: 700 22px/1 system-ui;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.agenda-nav-btn:hover {
  border-color: rgba(34, 105, 153, .62);
  background: var(--agenda-azul-controle-hover);
  box-shadow: 0 7px 16px rgba(30, 92, 133, .18), inset 0 1px 0 rgba(255, 255, 255, .64);
}

.agenda-nav-btn svg,
.agenda-data-cabecalho svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agenda-periodo {
  overflow: hidden;
  color: var(--secondary);
  font-size: 14px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-profissional-combo {
  position: relative;
  width: 200px;
  min-width: 0;
}

.agenda-profissional-combo summary {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  min-width: 0;
  padding: 0 13px 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--agenda-azul-controle);
  color: #0b3b5b;
  box-shadow: 0 5px 14px rgba(30, 92, 133, .13), inset 0 1px 0 rgba(255, 255, 255, .58);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.agenda-profissional-combo summary::-webkit-details-marker { display: none; }
.agenda-profissional-combo summary:hover,
.agenda-profissional-combo[open] summary {
  box-shadow: 0 7px 16px rgba(30, 92, 133, .18), inset 0 1px 0 rgba(255, 255, 255, .64);
}

.agenda-combo-seta {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  transition: transform 160ms ease;
}

.agenda-combo-seta svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agenda-profissional-combo[open] .agenda-combo-seta { transform: rotate(180deg); }

.agenda-profissional-opcoes {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: grid;
  width: max(100%, 224px);
  max-height: 270px;
  gap: 4px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid rgba(56, 122, 167, .24);
  border-radius: 20px;
  background: var(--agenda-azul-painel);
  box-shadow: 0 16px 32px rgba(20, 69, 103, .2), inset 0 1px 0 rgba(255, 255, 255, .62);
}

.agenda-profissional-opcoes button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #123f5d;
  font: 700 11.5px/1.25 system-ui;
  text-align: left;
  cursor: pointer;
}

.agenda-profissional-opcoes button:hover { background: rgba(235, 247, 254, .74); }
.agenda-profissional-opcoes button[aria-selected="true"] { background: var(--agenda-azul-controle); color: #082f49; }
.agenda-profissional-opcoes button[aria-selected="true"]::after { content: '✓'; font-weight: 900; }
.agenda-select-nativo { display: none !important; }

.agenda-visoes {
  padding: 3px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .46);
}

.agenda-visoes .btn { min-width: 58px; border: 0; background: transparent; box-shadow: none; }
.agenda-visoes .ativa { background: #fff; color: #0369a1; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }

.agenda-data-combo {
  position: relative;
  width: 148px;
}

.agenda-data-combo summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  width: 100%;
  height: 40px;
  align-items: center;
  box-sizing: border-box;
  padding: 0 5px 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--agenda-azul-controle);
  color: #0b3b5b;
  box-shadow: 0 5px 14px rgba(30, 92, 133, .13), inset 0 1px 0 rgba(255, 255, 255, .58);
  font: 700 12px/1 system-ui;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  list-style: none;
  transition: box-shadow 160ms ease;
}

.agenda-data-combo summary > #agendaDataRotulo {
  min-width: 0;
  text-align: center;
}

.agenda-data-combo summary::-webkit-details-marker { display: none; }
.agenda-data-combo summary:hover,
.agenda-data-combo[open] summary {
  box-shadow: 0 7px 16px rgba(30, 92, 133, .18), inset 0 1px 0 rgba(255, 255, 255, .64);
}

.agenda-data-icone {
  display: grid;
  width: 24px;
  height: 24px;
  justify-self: center;
  place-items: center;
  border-radius: 50%;
  background: var(--agenda-azul-suave);
  color: #0b4d74;
}

.agenda-data-icone svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agenda-data-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  width: 286px;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid rgba(56, 122, 167, .2);
  border-radius: 24px;
  background: var(--agenda-azul-painel);
  box-shadow: 0 18px 38px rgba(20, 69, 103, .22), inset 0 1px 0 rgba(255, 255, 255, .65);
}

.agenda-data-cabecalho {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.agenda-data-cabecalho strong { color: #0b3b5b; font-size: 12.5px; text-align: center; text-transform: capitalize; }
.agenda-data-cabecalho button,
.agenda-data-hoje {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(232, 246, 254, .7);
  color: #0b4d74;
  font-weight: 850;
  cursor: pointer;
}

.agenda-data-cabecalho button:hover,
.agenda-data-hoje:hover { background: rgba(112, 181, 226, .64); }

.agenda-data-semana,
.agenda-data-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.agenda-data-semana { margin-bottom: 4px; }
.agenda-data-semana span { color: #45677f; font-size: 9px; font-weight: 850; text-align: center; text-transform: uppercase; }
.agenda-data-dia {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #123f5d;
  font: 700 10.5px/1 system-ui;
  cursor: pointer;
}

.agenda-data-dia:hover { background: rgba(235, 247, 254, .78); }
.agenda-data-dia.outro-mes { color: #7892a4; opacity: .72; }
.agenda-data-dia.hoje { box-shadow: inset 0 0 0 2px rgba(2, 132, 199, .38); }
.agenda-data-dia.selecionado { background: #1688c9; color: #fff; box-shadow: 0 5px 12px rgba(2, 104, 167, .26); }
.agenda-data-rodape { display: flex; justify-content: flex-end; margin-top: 9px; }
.agenda-data-hoje { display: inline-grid; width: auto; padding: 0 13px; font-size: 10.5px; }

.agenda-busca-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#view-agenda.agenda-area-lista .agenda-busca-linha { display: none; }
#view-agenda.agenda-area-lista .agenda-controles { margin-bottom: 8px; }

.agenda-busca {
  display: flex;
  align-items: center;
  width: min(420px, 100%);
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .48);
}

.agenda-busca span { color: var(--text-muted); font-size: 18px; }
.agenda-busca input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-main); font: inherit; font-size: 12.5px; }
.agenda-busca input::placeholder { color: #94a3b8; }
.agenda-contagem { color: var(--text-muted); font-size: 11.5px; font-weight: 700; }

.agenda-estado {
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .56);
}

.agenda-estado p { margin: 5px 0 10px; color: var(--text-muted); font-size: 12px; }
.agenda-estado-erro { background: rgba(254, 226, 226, .7); color: #991b1b; }
.agenda-estado-permissao { background: rgba(254, 243, 199, .72); }

.agenda-grade-host { min-width: 0; }

.agenda-calendario {
  overflow: hidden;
  border: 1px solid rgba(74, 122, 158, .17);
  border-radius: 28px;
  background: rgba(255, 255, 255, .34);
  box-shadow: 0 8px 24px rgba(38, 89, 123, .08), inset 0 0 0 1px rgba(255, 255, 255, .42);
}

.agenda-calendario-scroll {
  max-height: min(68vh, 760px);
  overflow: auto;
  scrollbar-width: thin;
}

.agenda-calendario-head {
  position: sticky;
  z-index: 12;
  top: 0;
  display: grid;
  grid-template-columns: 58px repeat(var(--agenda-dias, 7), minmax(128px, 1fr));
  min-width: calc(58px + var(--agenda-dias, 7) * 128px);
  background: rgba(222, 236, 248, .72);
}

.agenda-head-vazio { border-right: 1px solid var(--agenda-linha); }

.agenda-dia-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 58px;
  border-right: 1px solid var(--agenda-linha);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.agenda-dia-head:first-of-type { border-top-left-radius: 18px; }
.agenda-dia-head:last-child { border-top-right-radius: 18px; }

.agenda-dia-head strong {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--secondary);
  font-size: 13px;
}

.agenda-dia-head.hoje strong { background: #0284c7; color: white; }
.agenda-dia-head.selecionado { color: #0369a1; font-weight: 800; }

.agenda-calendario-corpo {
  display: grid;
  grid-template-columns: 58px repeat(var(--agenda-dias, 7), minmax(128px, 1fr));
  min-width: calc(58px + var(--agenda-dias, 7) * 128px);
}

.agenda-horas,
.agenda-dia-lane { position: relative; height: calc(var(--agenda-slots, 24) * var(--agenda-slot-altura)); }

.agenda-horas {
  z-index: 4;
  border-right: 1px solid var(--agenda-linha);
  background: rgba(248, 250, 252, .5);
}

.agenda-hora-label {
  position: absolute;
  inset-inline: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  height: var(--agenda-slot-altura);
  padding: 0 4px;
  border-bottom: 1px solid var(--agenda-linha);
  background: rgba(222, 236, 248, .58);
  color: #48657d;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.agenda-dia-lane {
  border-right: 1px solid var(--agenda-linha);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--agenda-slot-altura) - 1px), var(--agenda-linha) calc(var(--agenda-slot-altura) - 1px), var(--agenda-linha) var(--agenda-slot-altura));
}

.agenda-dia-lane.hoje { background-color: rgba(224, 242, 254, .22); }

.agenda-celula {
  position: absolute;
  z-index: 1;
  left: 3px;
  width: calc(100% - 6px);
  height: var(--agenda-slot-altura);
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: cell;
}

.agenda-celula:hover { background: rgba(14, 165, 233, .07); }

.agenda-celula:hover::after {
  content: '＋';
  position: absolute;
  right: 7px;
  top: 5px;
  color: #0284c7;
  font-weight: 900;
}

.agenda-card.agenda-evento {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  top: var(--evento-top);
  left: calc(var(--evento-left) + 4px);
  width: calc(var(--evento-width) - 8px);
  min-height: 36px;
  height: max(38px, calc(var(--evento-altura) - 4px));
  overflow: hidden;
  padding: 5px 6px 4px 8px;
  border: 1px solid color-mix(in srgb, var(--prof-cor) 42%, transparent);
  border-left: 4px solid var(--prof-cor);
  border-radius: 9px;
  background: color-mix(in srgb, var(--prof-cor) 17%, rgba(255, 255, 255, .88));
  color: #0f172a;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
  text-align: left;
  cursor: pointer;
}

/* O shell dá superfície a toda .agenda-card; na grade semanal o evento é texto,
   não um cartão. Este escopo remove também essa superfície herdada. */
body.acs-shell #acs-conteudo .agenda-card.agenda-evento {
  background: color-mix(in srgb, var(--prof-cor) 17%, rgba(255, 255, 255, .88));
  border-color: color-mix(in srgb, var(--prof-cor) 42%, transparent);
  border-left-color: var(--prof-cor);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
}

.agenda-evento:hover { z-index: 9; background: color-mix(in srgb, var(--prof-cor) 26%, rgba(255, 255, 255, .86)); }
.agenda-evento:focus-visible { z-index: 10; outline: 3px solid #38bdf8; outline-offset: 2px; }
.agenda-evento strong { display: block; overflow: hidden; font-size: 11px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.agenda-evento small { display: block; overflow: hidden; color: #475569; font-size: 8.5px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.agenda-evento-medico-cor {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--prof-cor);
  vertical-align: 1px;
}
.agenda-evento .badge { display: none; }
.agenda-primeiro-atendimento {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid rgba(180, 83, 9, .2);
  border-radius: 999px;
  background: rgba(254, 243, 199, .9);
  color: #92400e;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agenda-evento .agenda-primeiro-atendimento {
  position: static;
  max-width: 100%;
  margin-top: 2px;
  padding: 1px 4px;
  font-size: 7.5px;
}

.agenda-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.agenda-lista .agenda-card {
  display: grid;
  grid-template-columns: 78px 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .5);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.agenda-lista .agenda-card:hover { background: rgba(255, 255, 255, .78); }
.agenda-card-hora { color: var(--secondary); font-weight: 900; font-variant-numeric: tabular-nums; }
.agenda-card-corpo { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.agenda-card-corpo span { overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-card-corpo .agenda-primeiro-atendimento { color: #92400e; font-size: 9px; }

/* Lista operacional: alta densidade sem reproduzir a grade legada. */
.agenda-lista-operacional {
  overflow: hidden;
  border: 1px solid rgba(55, 91, 121, .16);
  border-radius: 18px;
  background: rgba(222, 238, 249, .72);
}

.agenda-lista-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px 9px 16px;
  border-bottom: 1px solid rgba(55, 91, 121, .16);
  background: rgba(195, 222, 242, .78);
}

.agenda-lista-toolbar > div { display: grid; gap: 2px; }
.agenda-lista-toolbar strong { color: #0d2f4b; font-size: 12.5px; }
.agenda-lista-toolbar span { color: #526f86; font-size: 10.5px; }

.agenda-colunas-menu { position: relative; z-index: 20; flex: 0 0 auto; }
.agenda-colunas-menu summary {
  padding: 7px 11px;
  border: 1px solid rgba(55, 91, 121, .24);
  border-radius: 10px;
  background: rgba(240, 248, 253, .84);
  color: #173b57;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.agenda-colunas-menu summary::-webkit-details-marker { display: none; }
.agenda-colunas-menu summary::after { content: ' ▾'; color: #56758c; }
.agenda-colunas-menu[open] summary::after { content: ' ▴'; }
.agenda-colunas-menu fieldset {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 248px;
  max-height: 390px;
  gap: 2px;
  overflow: auto;
  padding: 11px;
  border: 1px solid rgba(55, 91, 121, .2);
  border-radius: 14px;
  background: #eff8fe;
  box-shadow: 0 18px 45px rgba(15, 52, 80, .2);
}
.agenda-colunas-menu legend { padding: 0 3px 7px; color: #56758c; font-size: 10px; }
.agenda-colunas-menu label { display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 8px; color: #1c405c; font-size: 11px; cursor: pointer; }
.agenda-colunas-menu label:hover { background: rgba(187, 220, 243, .55); }
.agenda-colunas-menu input { accent-color: #0284c7; }
.agenda-colunas-menu input:disabled { opacity: .55; }

.agenda-lista-scroll { max-height: min(65vh, 690px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.agenda-lista-operacional table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.agenda-lista-operacional th:nth-child(1) { width: 8%; }
.agenda-lista-operacional th:nth-child(2) { width: 16%; }
.agenda-lista-operacional th:nth-child(3) { width: 17%; }
.agenda-lista-operacional th:nth-child(4) { width: 15%; }
.agenda-lista-operacional th:nth-child(5) { width: 10%; }
.agenda-lista-operacional th:nth-child(6) { width: 9%; }
.agenda-lista-operacional th:nth-child(7) { width: 10%; }
.agenda-lista-operacional th:nth-child(8) { width: 9%; }
.agenda-lista-operacional th:nth-child(9) { width: 8%; }
.agenda-lista-operacional thead { position: sticky; z-index: 8; top: 0; }
.agenda-lista-operacional th {
  overflow: hidden;
  padding: 7px 5px;
  border-bottom: 1px solid rgba(55, 91, 121, .18);
  background: color-mix(in srgb, #c4def3 94%, white);
  color: #47647b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .045em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.agenda-lista-operacional td {
  max-width: 0;
  overflow: hidden;
  padding: 7px 5px;
  border-bottom: 1px solid rgba(55, 91, 121, .12);
  color: #284a63;
  font-size: 10.5px;
  line-height: 1.25;
  vertical-align: middle;
}
.agenda-lista-operacional tbody tr { background: transparent; }
.agenda-lista-operacional tbody tr td { background: rgba(239, 248, 254, .54); }
.agenda-lista-operacional tbody tr:nth-child(even) td { background: rgba(210, 231, 246, .52); }
.agenda-lista-operacional tbody tr:hover td { background: rgba(183, 218, 242, .72); }
.agenda-lista-operacional tbody tr:last-child td { border-bottom: 0; }
.agenda-lista-operacional td > strong,
.agenda-lista-operacional td > small { display: block; }
.agenda-lista-operacional td > strong { overflow: hidden; color: #102f47; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-lista-operacional td > small { margin-top: 2px; overflow: hidden; color: #6a8396; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-lista-hora { color: #082f4d !important; font-size: 12px !important; font-variant-numeric: tabular-nums; }
.agenda-lista-contato { display: flex; min-width: 0; align-items: center; gap: 4px; margin-top: 2px; overflow: hidden; color: #607b90; font-size: 8.7px; white-space: nowrap; }
.agenda-lista-contato > span { overflow: hidden; text-overflow: ellipsis; }
.agenda-lista-contato button { display: grid; width: 19px; height: 19px; flex: 0 0 19px; padding: 0; border: 1px solid rgba(37,211,102,.24); border-radius: 50%; place-items: center; background: rgba(255,255,255,.48); cursor: pointer; }
.agenda-lista-contato button img { width: 12px; height: 12px; }
.agenda-lista-contato button:hover { border-color: rgba(37,211,102,.62); background: rgba(255,255,255,.78); }
.agenda-lista-profissional { display: flex; min-width: 0; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-lista-profissional .agenda-cor { width: 7px; height: 7px; flex: 0 0 7px; box-shadow: none; }
.agenda-lista-selo { display: inline-flex; max-width: 100%; overflow: hidden; padding: 3px 5px; border-radius: 999px; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.agenda-lista-selo-ok { background: #d1fae5; color: #047857; }
.agenda-lista-selo-alerta { background: #fee2e2; color: #b91c1c; }
.agenda-lista-selo-neutro { background: #e0edf7; color: #315a78; }
.agenda-lista-pendencia { display: inline-flex; max-width: 100%; overflow: hidden; padding: 3px 5px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.agenda-lista-sem-pendencia { color: #8da0ae; }
.agenda-lista-operacional .badge { font-size: 8.5px; white-space: nowrap; }
.agenda-lista-acao { position: static; width: 58px !important; min-width: 58px; text-align: center !important; }
.agenda-lista-operacional th.agenda-lista-acao { background: color-mix(in srgb, #c4def3 94%, white); }
.agenda-lista-acao .btn { min-height: 30px; padding: 5px 9px; font-size: 9.5px; }

/* Visão operacional diária: alta densidade sem repetir o paciente por exame. */
.agenda-dia-operacional {
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, .24);
}

.agenda-dia-resumo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--agenda-linha);
  color: var(--text-muted);
  font-size: 11px;
}

.agenda-dia-resumo span { display: inline-flex; align-items: baseline; gap: 5px; }
.agenda-dia-resumo strong { color: var(--secondary); font-size: 16px; }

.agenda-dia-cabecalho,
.agenda-dia-linha {
  display: grid;
  grid-template-columns: 72px minmax(145px, 1.05fr) minmax(230px, 1.7fr) 70px minmax(135px, .95fr) 105px 94px;
  gap: 12px;
  align-items: center;
}

.agenda-dia-cabecalho {
  padding: 9px 14px;
  border-bottom: 1px solid var(--agenda-linha);
  color: #64748b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.agenda-dia-linhas { display: flex; flex-direction: column; }

.agenda-dia-linha {
  width: 100%;
  min-height: 54px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--agenda-linha);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease;
}

.agenda-dia-linha:last-child { border-bottom: 0; }
.agenda-dia-linha:hover { background: rgba(255, 255, 255, .48); }
.agenda-dia-linha:focus-visible { outline: 3px solid #38bdf8; outline-offset: -3px; }
.agenda-dia-linha-cancelada { background: rgba(254, 226, 226, .2); }
.agenda-dia-linha-cancelada .agenda-dia-paciente strong,
.agenda-dia-linha-cancelada .agenda-dia-servicos strong { color: #64748b; }

.agenda-dia-linha > span,
.agenda-dia-linha > .badge { min-width: 0; }

.agenda-dia-horario,
.agenda-dia-paciente,
.agenda-dia-servicos { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.agenda-dia-horario strong { color: var(--secondary); font-size: 14px; font-variant-numeric: tabular-nums; }
.agenda-dia-horario small,
.agenda-dia-servicos small { color: var(--text-muted); font-size: 9px; }
.agenda-dia-paciente strong,
.agenda-dia-servicos strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-dia-paciente strong { color: #0f172a; font-size: 11.5px; }
.agenda-dia-paciente em {
  width: fit-content;
  color: #a16207;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 800;
}
.agenda-dia-servicos strong { color: #334155; font-size: 10.5px; }
.agenda-dia-duracao,
.agenda-dia-cobertura { overflow: hidden; color: #475569; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-dia-profissional { display: flex; min-width: 0; align-items: center; gap: 7px; }
.agenda-dia-profissional .agenda-cor { flex: 0 0 auto; width: 7px; height: 7px; box-shadow: none; }
.agenda-dia-profissional span { overflow: hidden; color: #334155; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-dia-linha > .badge { justify-self: start; white-space: nowrap; }

.agenda-dia-vazio {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .24);
  color: var(--text-muted);
  font-size: 12px;
}

.agenda-dia-vazio strong { color: var(--secondary); font-size: 14px; }

@media (max-width: 1120px) {
  .agenda-dia-operacional { overflow-x: auto; }
  .agenda-dia-cabecalho,
  .agenda-dia-linha { min-width: 980px; }
}

.agenda-vazio-dia,
.agenda-muted,
.agenda-loading { color: var(--text-muted); font-size: 12px; }

.agenda-loading { padding: 26px; text-align: center; }
.agenda-erro { color: var(--danger); font-size: 12px; }

.agenda-sheet {
  position: fixed;
  z-index: 2400;
  right: 24px;
  bottom: 24px;
  width: min(430px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  border: 0;
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg-card, #fff) 94%, transparent);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
  backdrop-filter: blur(24px);
}

.agenda-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.agenda-sheet-head h3 { margin: 0; font-size: 16px; }
.agenda-dl { display: grid; grid-template-columns: 115px 1fr; gap: 7px 12px; margin-bottom: 12px; font-size: 12px; }
.agenda-dl dt { color: var(--text-muted); }
.agenda-sheet-acoes { display: flex; align-items: center; gap: 10px; margin: 4px 0 15px; }
.agenda-sheet-acoes span { color: var(--text-muted); font-size: 11px; }
.agenda-status-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.agenda-status-acoes .btn-danger,
.agenda-cancelamento-box .btn-danger { border-color: #dc2626; background: #dc2626; color: #fff; }
.agenda-status-acoes .btn-danger:hover,
.agenda-cancelamento-box .btn-danger:hover { background: #b91c1c; }
.agenda-status-acoes .agenda-btn-ausencia { border-color: rgba(217, 119, 6, .45); color: #92400e; }
.agenda-ausencia-box .btn-warning { border-color: #d97706; background: #d97706; color: #fff; }
.agenda-ausencia-box .btn-warning:hover { background: #b45309; }
.agenda-cancelamento-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin: 0 0 15px;
  border-radius: 15px;
  background: rgba(254, 226, 226, .56);
}
.agenda-ausencia-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin: 0 0 15px;
  border-radius: 15px;
  background: rgba(254, 243, 199, .58);
}
.agenda-ausencia-box label { color: #92400e; font-size: 11px; font-weight: 800; }
.agenda-ausencia-box textarea { resize: vertical; }
.agenda-ausencia-box > div { display: flex; flex-wrap: wrap; gap: 7px; }
.agenda-ausencia-box > span { color: #92400e; font-size: 10px; }
.agenda-cancelamento-box label { color: #991b1b; font-size: 11px; font-weight: 800; }
.agenda-cancelamento-box textarea { resize: vertical; }
.agenda-cancelamento-box > div { display: flex; flex-wrap: wrap; gap: 7px; }
.agenda-cancelamento-box > span { color: #991b1b; font-size: 10px; }
.agenda-eventos { padding-left: 18px; font-size: 12px; }

/* Novo agendamento */
#modalNovoAgendamento.open {
  z-index: 2500;
  padding: 22px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(8px);
}

#modalNovoAgendamento .agenda-modal-card {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: calc(100vh - 36px);
  border: 0;
  border-radius: 24px;
  background: color-mix(in srgb, var(--bg-card, #fff) 96%, transparent);
  box-shadow: 0 30px 90px rgba(15, 23, 42, .3);
}

#modalNovoAgendamento .modal-header,
#modalNovoAgendamento .modal-footer { background: transparent; }
#modalNovoAgendamento .modal-body { display: grid; gap: 12px; background: transparent; }

.agenda-modal-secao {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(241, 245, 249, .62);
}

.agenda-modal-titulo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}

.agenda-modal-titulo > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  background: #0284c7;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.agenda-modal-titulo > div { display: flex; flex-direction: column; }
.agenda-modal-titulo strong { color: var(--secondary); font-size: 13px; }
.agenda-modal-titulo small { color: var(--text-muted); font-size: 10.5px; }

.agenda-segmentado {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(226, 232, 240, .72);
}

.agenda-segmentado label {
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.agenda-segmentado label:has(input:checked) { background: white; color: #0369a1; box-shadow: 0 3px 10px rgba(15, 23, 42, .08); }
.agenda-segmentado input { position: absolute; opacity: 0; pointer-events: none; }

.agenda-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.agenda-span-2 { grid-column: span 2; }
.agenda-modal-secao .form-group { margin-bottom: 0; }

.agenda-servicos-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 170px;
  overflow: auto;
}

.agenda-servico-opcao {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .58);
  cursor: pointer;
}

.agenda-servico-opcao:has(input:checked) { background: rgba(219, 234, 254, .82); box-shadow: inset 0 0 0 1px rgba(2, 132, 199, .18); }
.agenda-servico-opcao span { display: flex; min-width: 0; flex-direction: column; }
.agenda-servico-opcao strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-servico-opcao small { color: var(--text-muted); font-size: 10px; }

.agenda-duracao-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, .22);
  color: var(--text-muted);
  font-size: 11.5px;
}

.agenda-duracao-total strong { color: #0369a1; font-size: 15px; }

.agenda-slots { max-height: 210px; overflow: auto; }
.agenda-slots-legenda { margin: 0 0 7px; color: var(--text-muted); font-size: 11px; }
.agenda-slot-grupo { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.agenda-slot-grupo h5 { width: 48px; margin: 0; color: var(--secondary); font-size: 11.5px; }
.agenda-slot { display: flex; flex: 1; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 11px; background: rgba(255, 255, 255, .54); font-size: 11px; cursor: pointer; }
.agenda-slot span { display: flex; min-width: 0; flex-direction: column; }
.agenda-slot em { color: var(--text-muted); font-size: 9.5px; font-style: normal; }

.agenda-resumo { padding: 12px 14px; border-radius: 16px; background: rgba(224, 242, 254, .66); }
.agenda-resumo h4 { margin: 0 0 8px; color: #075985; font-size: 12px; }

#view-agenda .btn:focus-visible,
#modalNovoAgendamento .btn:focus-visible,
#modalNovoAgendamento .form-control:focus-visible,
#view-agenda input:focus-visible,
.agenda-profissional:focus-visible,
.agenda-celula:focus-visible { outline: 3px solid #38bdf8; outline-offset: 2px; }

@media (max-width: 780px) {
  .agenda-toolbar { align-items: stretch; flex-direction: column; }
  .agenda-toolbar-acoes { justify-content: flex-start; }
  .agenda-workspace { display: block; }
  .agenda-equipe { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; border: 0; }
  .agenda-equipe-head { display: none; }
  .agenda-profissional { width: auto; min-width: 160px; flex: 0 0 auto; background: rgba(255, 255, 255, .42); }
  #agendaProfissionaisLista { display: flex; gap: 6px; }
  .agenda-controles { grid-template-columns: 1fr; }
  .agenda-controles-direita { justify-content: space-between; }
  .agenda-periodo { grid-row: auto; text-align: left; }
  .agenda-profissional-combo { width: 100%; }
  .agenda-busca-linha { align-items: stretch; flex-direction: column; }
  .agenda-contagem { padding-left: 4px; }
  .agenda-form-grid, .agenda-servicos-box { grid-template-columns: 1fr; }
  .agenda-span-2 { grid-column: auto; }
  .agenda-dl { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  #modalNovoAgendamento.open { align-items: stretch; padding: 0; }
  #modalNovoAgendamento .agenda-modal-card { width: 100%; max-width: 100%; height: 100%; max-height: 100vh; border-radius: 0; }
  .agenda-visoes .btn { min-width: 52px; padding-inline: 7px; }
  .agenda-sheet { right: 8px; bottom: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}
