.appointment-date-control { position: relative; width: 100%; min-width: 0; }
.appointment-date-control #date { width: 100%; min-width: 0; padding-right: 36px; }
.appointment-date-control #date::-webkit-calendar-picker-indicator { display: none; }
.appointment-date-trigger {
  position: absolute;
  right: 0;
  top: 0;
  width: 36px;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
}
.appointment-date-trigger svg, .appointment-date-heading svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.appointment-date-popover {
  position: fixed;
  inset: auto;
  z-index: 1100;
  box-sizing: border-box;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: var(--text-primary);
  font-family: var(--font-ui);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.appointment-date-popover[hidden] { display: none; }
.appointment-date-popover::backdrop { background: transparent; }
.appointment-date-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.appointment-date-heading strong { font-size: var(--font-size-base); }
.appointment-date-heading button, .appointment-date-actions button {
  display: grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  padding: 6px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.appointment-date-master { margin: 6px 0 12px; color: var(--text-secondary); font-size: var(--font-size-sm); overflow-wrap: anywhere; }
.appointment-date-weekdays, .appointment-date-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.appointment-date-weekdays { margin-bottom: 4px; text-align: center; color: var(--text-secondary); font-size: var(--font-size-xs); }
.appointment-date-days button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 0;
  color: var(--text-primary);
  font-size: var(--font-size-md);
  font-weight: var(--weight-medium);
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.appointment-date-days button.is-working { color: var(--primary-dark); background: var(--primary-soft); }
.appointment-date-days button.is-off { color: var(--text-secondary); background: var(--surface-soft); }
.appointment-date-days button.is-selected { border-color: var(--primary-dark); box-shadow: inset 0 0 0 1px var(--primary-dark); font-weight: var(--weight-bold); }
.appointment-date-days button.is-today span { text-decoration: underline; text-underline-offset: 3px; }
.appointment-date-days i, .appointment-date-legend i { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.appointment-date-days .is-working i, .appointment-date-legend .is-working { background: var(--primary-dark); }
.appointment-date-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; color: var(--text-secondary); font-size: var(--font-size-xs); }
.appointment-date-legend span { display: inline-flex; align-items: center; gap: 5px; }
.appointment-date-legend .is-off { background: var(--text-muted); }
.appointment-date-status, .appointment-date-shift { margin: 8px 0 0; font-size: var(--font-size-sm); line-height: var(--line-normal); }
.appointment-date-status { color: var(--text-secondary); }
.appointment-date-status.is-error { color: var(--danger); }
.appointment-date-shift { color: var(--primary-dark); }
.appointment-date-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; }
.appointment-date-actions button { font-size: var(--font-size-sm); padding-inline: 10px; }
.appointment-date-popover button:focus-visible, .appointment-date-trigger:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 1px; }
