.agenda-tools {
  --agenda-tool-surface: #fbfcf9;
  display: flex;
  gap: 8px;
  margin-left: auto;
}
[data-theme=dark] .agenda-tools { --agenda-tool-surface: #182720; }
.agenda-tool-trigger {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--agenda-tool-surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.agenda-tool-trigger:hover,
.agenda-tools:has(#agenda-filters:popover-open) .agenda-filters-trigger,
.agenda-tools:has(#agenda-options:popover-open) .agenda-options-trigger {
  background: var(--soft);
  border-color: var(--green);
}
.agenda-tool-trigger .icon { width: 16px; height: 16px; color: var(--green); }
.agenda-tool-trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.agenda-options-trigger { width: 36px; padding: 0; anchor-name: --agenda-tools-edge; }
.agenda-options-trigger .icon { stroke-width: 3; }
.agenda-filter-count {
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 99px;
  padding: 0 4px;
  background: var(--soft);
  color: var(--ink);
  font-size: 10px;
}
.agenda-filter-count[hidden] { display: none; }
.agenda-tool-panel {
  position: fixed;
  position-anchor: --agenda-tools-edge;
  inset: auto;
  top: calc(anchor(bottom) + 8px);
  right: anchor(right);
  position-try-fallbacks: flip-block;
  margin: 0;
  padding: 0;
  max-height: min(440px, calc(100dvh - 165px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--agenda-tool-surface);
  color: var(--ink);
  box-shadow: 0 12px 32px #152d2429;
}
.agenda-options-panel { min-width: 174px; padding: 5px; }
#agenda-options > [data-action=agenda-pending] { background: transparent; border: 0; box-shadow: none; }
.agenda-options-panel button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
.agenda-options-panel button:hover,
.agenda-options-panel button:focus-visible,
#agenda-options > [data-action=agenda-pending]:is(:hover,:focus-visible) { background: var(--soft); }
.agenda-options-panel .icon { width: 15px; height: 15px; color: var(--green); }
.agenda-filter-panel {
  display: grid;
  width: min(288px, calc(100vw - 36px));
  gap: 12px;
  padding: 14px;
}
.agenda-period { margin: 0; padding: 0; border: 0; min-width: 0; }
.agenda-period legend { margin-bottom: 5px; padding: 0; font-size: 12px; color: var(--muted); }
.agenda-period > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.agenda-period label { position: relative; cursor: pointer; }
.agenda-period input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.agenda-period span { display: block; padding: 7px; text-align: center; border-radius: 6px; font-size: 12px; }
.agenda-period input:checked + span { background: var(--soft); font-weight: 650; }
.agenda-period input:focus-visible + span { outline: 2px solid var(--green); }
.agenda-filter-panel .field select { width: 100%; min-width: 0; }
.agenda-filter-panel select:disabled { opacity: .6; }
.agenda-filter-buttons { display: flex; }
.agenda-filter-buttons .btn { min-height: 33px; font-size: 12px; padding: 6px 10px; }

.agenda-follow-up {
  --agenda-status-fill: #e5eff8;
  --agenda-status-rim: #638caa;
  --agenda-status-text: #2b4f6a;
  --agenda-status-muted: #3f607b;
  --agenda-status-shine: #7bb7eb40;
}
[data-theme=dark] .agenda-follow-up {
  --agenda-status-fill: #254457;
  --agenda-status-rim: #83b3d1;
  --agenda-status-text: #e2f2fc;
  --agenda-status-muted: #c1dded;
  --agenda-status-shine: #7bb7eb33;
}
.agenda-follow-up.done { --agenda-status-fill: #c7dce9; }
[data-theme=dark] .agenda-follow-up.done { --agenda-status-fill: #1f3749; }

.agenda-financial {
  --agenda-status-fill: #ececf2;
  --agenda-status-rim: #818299;
  --agenda-status-text: #41435b;
  --agenda-status-muted: #53556e;
  --agenda-status-shine: #8589af40;
}
[data-theme=dark] .agenda-financial {
  --agenda-status-fill: #363747;
  --agenda-status-rim: #a7a9c7;
  --agenda-status-text: #eeeffa;
  --agenda-status-muted: #d0d2e7;
  --agenda-status-shine: #a5a8d133;
}
.agenda-financial.done { --agenda-status-fill: #dcdde8; }
[data-theme=dark] .agenda-financial.done { --agenda-status-fill: #292a39; }

:is(#app,#dialogs) .agenda-card.agenda-commitment:is(.agenda-follow-up,.agenda-financial),
#app .agenda-grid.agenda-day .agenda-card:is(.agenda-follow-up,.agenda-financial),
#app .agenda-week .agenda-card:is(.agenda-follow-up,.agenda-financial) {
  background: var(--agenda-status-fill) !important;
  border-color: color-mix(in srgb, var(--agenda-status-rim) 55%, transparent);
  border-left-color: var(--agenda-status-rim) !important;
  --ad-item-shine: var(--agenda-status-shine);
  --aw-item-shine: var(--agenda-status-shine);
}
:is(#app,#dialogs) .agenda-card.agenda-commitment:is(.agenda-follow-up,.agenda-financial):hover,
:is(#app,#dialogs) .agenda-card.agenda-commitment:is(.agenda-follow-up,.agenda-financial):focus-within {
  box-shadow: 0 0 16px var(--agenda-status-shine);
}
.agenda-card:is(.agenda-follow-up,.agenda-financial) .agenda-item-open > span,
.agenda-card:is(.agenda-follow-up,.agenda-financial) .agenda-item-actions .iconbtn { color: var(--agenda-status-text); }
.agenda-card:is(.agenda-follow-up,.agenda-financial) .agenda-item-open > small { color: var(--agenda-status-muted); }
#app .agenda-month .agenda-mini:is(.agenda-follow-up,.agenda-financial),
#dialogs :is(.agenda-follow-up,.agenda-financial) .agenda-type-pill {
  background: var(--agenda-status-fill);
  color: var(--agenda-status-text);
  border-color: var(--agenda-status-rim);
}
.agenda-pending-item:is(.agenda-follow-up,.agenda-financial) { border-left-color: var(--agenda-status-rim); }
.agenda-legend .legend-follow-up::before { background: #638caa; }
.agenda-legend .legend-financial::before { background: #818299; }
.agenda-legend { flex-wrap: wrap; }
