/* Appointment dashboard — PEUF / enterprise_ui aligned */

.appt-dashboard {
  width: 100%;
}

.appt-dashboard .eu-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.appt-dashboard__filters .eu-card__body {
  padding: 16px 18px;
}

.appt-filter-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.appt-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  width: 100%;
}

.appt-filter-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.appt-filter-field--actions {
  justify-content: flex-end;
}

.appt-filter-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.appt-filter-field .eu-input,
.appt-filter-field .eu-select {
  width: 100%;
  box-sizing: border-box;
}

.appt-modal__panel--wide {
  width: min(640px, 100%);
}

.appt-modal__panel--sheet {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px);
  padding: 0;
  overflow: hidden;
}

.appt-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
  flex: 0 0 auto;
}

.appt-modal__header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.appt-modal__header .appt-modal__sub {
  margin: 2px 0 0;
}

.appt-modal__x {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--eu-text-muted, #64748b);
  padding: 0 4px;
}

.appt-modal__form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.appt-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
}

.appt-modal__footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--eu-border, #e2e8f0);
  background: var(--eu-surface, #fff);
  flex: 0 0 auto;
}

.appt-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.appt-modal .eu-field--tight {
  margin-bottom: 8px;
}

.appt-slot-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-bottom: 6px;
}

.appt-slot-toolbar .eu-label {
  margin: 0;
}

.appt-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 8px;
  background: var(--eu-surface-2, #f8fafc);
}

.appt-slot {
  padding: 6px 4px;
}

.appt-schedule-context {
  margin-bottom: 8px;
  padding: 8px 10px;
  font-size: 11px;
}

@media (max-width: 640px) {
  .appt-modal__row {
    grid-template-columns: 1fr;
  }

  .appt-modal__panel--sheet {
    max-height: 92vh;
  }

  .appt-slot-grid {
    max-height: 140px;
  }
}

.appt-slot-grid__hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--eu-text-muted, #64748b);
}

.appt-slot {
  border: 1px solid var(--eu-border, #e2e8f0);
  background: #fff;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.appt-slot--leave {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #5b21b6;
}

.appt-slot__time {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.appt-slot__occ {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 84px;
}

.appt-slot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 11px;
}

.appt-slot-legend__item::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
  border: 1px solid transparent;
}

.appt-slot-legend__item--available::before { background: #f0fdf4; border-color: #86efac; }
.appt-slot-legend__item--overbook::before { background: #fffbeb; border-color: #fcd34d; }
.appt-slot-legend__item--full::before { background: #fff1f2; border-color: #fda4af; }
.appt-slot-legend__item--leave::before { background: #f5f3ff; border-color: #c4b5fd; }

.appt-schedule-context {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--eu-surface-2, #f8fafc);
  border: 1px solid var(--eu-border, #e2e8f0);
  font-size: 12px;
  line-height: 1.45;
}

.appt-schedule-context__line + .appt-schedule-context__line {
  margin-top: 4px;
}

.appt-ctx-leave {
  color: #6d28d9;
  font-weight: 600;
}

.appt-slot--available {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.appt-slot--overbook {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.appt-slot--full {
  border-color: #fda4af;
  background: #fff1f2;
  color: #9f1239;
}

.appt-slot--past {
  opacity: 0.45;
  cursor: not-allowed;
}

.appt-slot.is-selected {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.appt-slot.is-pack {
  box-shadow: inset 0 0 0 2px #2563eb;
  font-weight: 700;
}

.appt-pack-preview {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.appt-pack-preview.is-warn {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.appt-override-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.appt-override-box__msg {
  margin: 0 0 8px;
  font-size: 13px;
  color: #9a3412;
  font-weight: 600;
}

.appt-qr svg {
  margin: 12px auto;
  display: inline-block;
}

.appt-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  padding-top: 2px;
}

.appt-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  background: var(--eu-surface-2, #f1f5f9);
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}

.appt-tabs__item {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--eu-muted, #64748b);
  text-decoration: none;
}

.appt-tabs__item:hover {
  color: var(--eu-text, #0f172a);
  background: rgba(255, 255, 255, 0.7);
}

.appt-tabs__item.is-active {
  color: var(--eu-text, #0f172a);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.appt-group-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--eu-muted, #64748b);
  line-height: 1.45;
}

.appt-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--eu-surface-2, #f1f5f9);
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
}

.appt-bulk-bar[hidden] {
  display: none !important;
}

.appt-bulk-bar__count {
  font-size: 13px;
  color: var(--eu-text, #0f172a);
}

.appt-col-check {
  width: 36px;
  text-align: center;
}

.appt-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.appt-inline-form {
  display: inline;
  margin: 0;
}

.appt-check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--eu-text, #0f172a);
  cursor: pointer;
}

.appt-check-label input {
  margin-top: 2px;
}

.appt-series-field {
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--eu-surface-2, #f8fafc);
  border-radius: 8px;
}

.appt-week-grid {
  display: grid;
  gap: 12px;
}

.appt-week-grid--1 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.appt-week-grid--2 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* —— Filter drawer + context —— */
.appt-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.appt-filter-trigger__icon {
  font-size: 16px;
  line-height: 1;
}

.appt-title-meta {
  font-weight: 500;
  color: var(--eu-muted, #64748b);
  font-size: 0.85em;
}

.eu-page-header--compact .eu-page-subtitle {
  display: none;
}

.appt-week .eu-page-header {
  align-items: center;
  margin-bottom: 12px;
}

.appt-week .eu-page-header--compact .eu-breadcrumb {
  margin-bottom: 2px;
}

.appt-week .appt-header-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.appt-week .appt-header-actions .eu-btn,
.appt-week .appt-header-actions summary.eu-btn {
  list-style: none;
}

.appt-week .appt-header-actions summary.eu-btn::-webkit-details-marker {
  display: none;
}

.appt-related {
  position: relative;
}

.appt-related > summary {
  list-style: none;
  cursor: pointer;
}

.appt-related > summary::-webkit-details-marker {
  display: none;
}

.appt-related__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.appt-related__link {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--eu-text, #0f172a);
  text-decoration: none;
}

.appt-related__link:hover {
  background: #f1f5f9;
}

.appt-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.appt-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
}

.appt-chrome__context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.appt-chrome__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.appt-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: var(--eu-field-h-sm, 32px);
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: var(--eu-muted, #64748b);
}

.appt-context-chip strong {
  color: var(--eu-text, #0f172a);
  font-weight: 700;
}

.appt-context-chip--btn {
  cursor: pointer;
  font: inherit;
}

.appt-context-chip--btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.appt-span-seg {
  display: inline-flex;
  align-items: center;
  height: var(--eu-field-h-sm, 32px);
  box-sizing: border-box;
  padding: 2px;
  background: #e2e8f0;
  border-radius: 8px;
}

.appt-span-seg__item {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--eu-muted, #64748b);
  text-decoration: none;
}

.appt-span-seg__item.is-active {
  background: #fff;
  color: var(--eu-text, #0f172a);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.appt-cal-toolbar__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.appt-cal-toolbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--eu-text, #0f172a);
  min-width: 7rem;
  text-align: center;
}

.appt-legend-details {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--eu-muted, #64748b);
}

.appt-legend-details > summary {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.appt-legend-details[open] > summary {
  margin-bottom: 6px;
}

.appt-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.appt-cal-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--eu-muted, #64748b);
}

.appt-cal-legend__item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.appt-cal-legend__item--scheduled::before { background: #dbeafe; border-color: #93c5fd; }
.appt-cal-legend__item--paid::before { background: #e0e7ff; border-color: #a5b4fc; }
.appt-cal-legend__item--arrived::before { background: #dcfce7; border-color: #86efac; }
.appt-cal-legend__item--progress::before { background: #fef3c7; border-color: #fcd34d; }
.appt-cal-legend__item--done::before { background: #f1f5f9; border-color: #cbd5e1; }
.appt-cal-legend__item--cancelled::before { background: #fee2e2; border-color: #fca5a5; }

.appt-cal-card--month {
  padding: 3px 6px;
  border-left-width: 3px;
}

.appt-cal-card--month .appt-cal-card__top {
  margin-bottom: 0;
}

.appt-cal-card--month .appt-cal-card__time {
  font-size: 10px;
}

.appt-cal-card--month .appt-cal-card__name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appt-month-day__num-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
}

.appt-month-day__num-btn:disabled {
  cursor: default;
}

.appt-month-day__num-btn:not(:disabled):hover .appt-month-day__num {
  color: #1d4ed8;
}

.appt-month-day__more {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
}

.appt-month-day__more:hover {
  background: #eff6ff;
}

.appt-month-day__book,
.appt-week-day__book,
.appt-board__book {
  display: block;
  width: 100%;
  border: 1px dashed #cbd5e1;
  background: transparent;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 6px;
  margin-top: 4px;
}

.appt-month-day__book:hover,
.appt-week-day__book:hover,
.appt-board__book:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.appt-cal-card__hit {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.appt-day-panel__toolbar {
  padding: 0 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-quick-book__results {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
}

.appt-quick-book__results li {
  border-bottom: 1px solid #f1f5f9;
}

.appt-quick-book__results li:last-child {
  border-bottom: 0;
}

.appt-quick-book__hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}

.appt-quick-book__hit:hover {
  background: #f8fafc;
}

.appt-quick-book__empty {
  padding: 10px;
  font-size: 12px;
  color: #64748b;
}

.appt-quick-book__picked {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.appt-modal__hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}

.appt-month-day__duty {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.appt-day-source {
  display: none !important;
}

.appt-day-panel__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 80;
}

.appt-day-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 94vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--eu-border, #e2e8f0);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  z-index: 90;
  display: flex;
  flex-direction: column;
}

.appt-day-panel[hidden],
.appt-day-panel__backdrop[hidden],
.appt-drawer[hidden],
.appt-drawer__backdrop[hidden],
.appt-quick-search__results[hidden] {
  display: none !important;
}

.appt-day-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-day-panel__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.appt-day-panel__body {
  padding: 14px 16px;
  overflow: auto;
  flex: 1;
}

.appt-day-panel__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appt-board__empty-quiet {
  min-height: 24px;
}

.appt-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 80;
}

.appt-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--eu-border, #e2e8f0);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  z-index: 90;
  display: flex;
  flex-direction: column;
}

.appt-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-drawer__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.appt-drawer__x {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--eu-muted, #64748b);
}

.appt-drawer__form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.appt-drawer__body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  flex: 1;
}

.appt-drawer__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--eu-border, #e2e8f0);
}

/* —— Month calendar —— */
.appt-month {
  background: var(--eu-surface, #fff);
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
}

.appt-month__dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f1f5f9;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-month__dow-cell {
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--eu-muted, #64748b);
}

.appt-month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.appt-month-day {
  min-height: 140px;
  border-right: 1px solid var(--eu-border, #e2e8f0);
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.appt-month-day:nth-child(7n) {
  border-right: 0;
}

.appt-month-day.is-outside {
  background: #f8fafc;
  opacity: 0.55;
}

.appt-month-day.is-today {
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 45%, #fff 100%);
  box-shadow: inset 0 0 0 2px #2563eb;
}

.appt-month-day.is-leave {
  background: #faf5ff;
}

.appt-month-day__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 4px;
}

.appt-month-day__num {
  font-size: 13px;
  font-weight: 700;
  color: var(--eu-text, #0f172a);
}

.appt-month-day.is-today .appt-month-day__num {
  color: #1d4ed8;
}

.appt-month-day__today-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: #2563eb;
  vertical-align: middle;
}

.appt-month-day__leave {
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  text-transform: uppercase;
}

.appt-month-day__duty {
  font-size: 10px;
  font-weight: 600;
  color: #1d4ed8;
}

.appt-month-day__count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
}

.appt-month-day__body {
  padding: 0 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: auto;
  max-height: 220px;
}

.appt-month-day__empty {
  margin: auto 0;
  text-align: center;
  font-size: 11px;
  color: #cbd5e1;
}

.appt-month-day__more {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  padding: 2px 4px;
}

.appt-month-day .appt-cal-card--compact {
  padding: 4px 6px;
}

.appt-month-day .appt-cal-card__actions .eu-btn {
  padding: 1px 5px;
  font-size: 10px;
}

.appt-week-day {
  background: var(--eu-surface, #fff);
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 12px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.appt-week-day.is-today {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.appt-week-day__head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
  background: #f8fafc;
}

.appt-week-day__dow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--eu-muted, #64748b);
}

.appt-week-day__date {
  font-size: 16px;
  font-weight: 700;
  color: var(--eu-text, #0f172a);
}

.appt-week-day__duty {
  margin-top: 2px;
  font-size: 11px;
  color: #1d4ed8;
  font-weight: 600;
}

.appt-week-day__body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.appt-cal-card {
  border: 1px solid var(--eu-border, #e2e8f0);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.appt-cal-card--scheduled { border-left-color: #3b82f6; background: #f8fbff; }
.appt-cal-card--paid { border-left-color: #6366f1; background: #f8f7ff; }
.appt-cal-card--arrived { border-left-color: #16a34a; background: #f3fdf6; }
.appt-cal-card--progress { border-left-color: #d97706; background: #fffbeb; }
.appt-cal-card--done { border-left-color: #94a3b8; background: #f8fafc; }
.appt-cal-card--cancelled { border-left-color: #dc2626; background: #fff5f5; opacity: 0.85; }

.appt-cal-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.appt-cal-card__time {
  font-size: 12px;
  font-weight: 700;
  color: var(--eu-text, #0f172a);
}

.appt-cal-card__name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.appt-cal-card__meta {
  font-size: 11px;
  color: var(--eu-muted, #64748b);
  margin-bottom: 6px;
}

.appt-cal-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.appt-cal-card--compact .appt-cal-card__actions .eu-btn {
  padding: 2px 6px;
  font-size: 11px;
}

.appt-board__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appt-opd-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
}

.appt-doctor-opd {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.appt-doctor-opd__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--eu-muted, #64748b);
  margin-bottom: 6px;
}

.appt-doctor-opd__row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  margin-bottom: 4px;
}

.appt-doctor-opd__row span {
  color: var(--eu-muted, #64748b);
  font-size: 11px;
}

.appt-doctor-opd--week {
  margin-bottom: 12px;
}

.appt-doctor-opd__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.appt-duty-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  color: #1e3a8a;
}

.appt-duty-chip.is-off {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.appt-board__meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--eu-text-muted, #64748b);
}

.appt-board__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.appt-board__col .eu-card__header,
.appt-board__unassigned .eu-card__header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-board__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appt-board__item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 8px;
  background: var(--eu-surface, #fff);
}

.appt-board__time {
  flex: 0 0 72px;
  font-size: 12px;
  font-weight: 700;
  color: var(--eu-text-muted, #64748b);
}

.appt-board__body {
  min-width: 0;
  flex: 1;
}

.appt-board__meta-line {
  margin-top: 2px;
  font-size: 11px;
  color: var(--eu-text-muted, #64748b);
}

.appt-board__empty-col {
  margin: 0;
  font-size: 12px;
  color: var(--eu-text-muted, #64748b);
  text-align: center;
  padding: 16px 0;
}

.appt-board__unassigned {
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .appt-week-grid--1,
  .appt-week-grid--2 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .appt-week-grid--1,
  .appt-week-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.appt-dashboard__results {
  flex: 1;
  min-width: 0;
}

.appt-dashboard__results .eu-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-dashboard__results .eu-card__title {
  margin: 0;
}

.appt-dashboard__results .eu-card__subtitle {
  margin: 2px 0 0;
  color: var(--eu-text-muted, #64748b);
}

.appt-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.appt-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.appt-table th,
.appt-table td {
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
}

.appt-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eu-text-muted, #64748b);
  background: var(--eu-surface-2, #f8fafc);
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-table td {
  font-size: 13px;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-col-patient {
  white-space: normal;
  min-width: 140px;
  max-width: 220px;
}

.appt-col-sl,
.appt-col-ref {
  width: 56px;
}

.appt-col-actions {
  width: 1%;
  white-space: nowrap;
}

.appt-slot__date {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
}

.appt-slot__time {
  font-size: 11px;
  color: var(--eu-text-muted, #64748b);
  margin-top: 2px;
}

.appt-row-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.appt-empty {
  padding: 40px 16px !important;
  text-align: center;
  color: var(--eu-text-muted, #64748b);
  white-space: normal !important;
}

.appt-pagination {
  padding: 12px 18px;
  border-top: 1px solid var(--eu-border, #e2e8f0);
}

.eu-req {
  color: var(--eu-danger, #be123c);
}

.appt-modal[hidden] {
  display: none !important;
}

.appt-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.appt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.appt-modal__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: var(--eu-surface, #fff);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  max-height: min(88vh, 640px);
  overflow: auto;
}

.appt-modal__panel h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.appt-modal__sub {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--eu-text-muted, #64748b);
}

.appt-modal .eu-field {
  margin-bottom: 8px;
}

.appt-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Reschedule sheet: sticky footer, scroll body (must follow base panel rules) */
.appt-modal__panel.appt-modal__panel--sheet {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: min(88vh, 720px);
  padding: 0;
  overflow: hidden;
}

.print-only {
  display: none;
}

@media (max-width: 1200px) {
  .appt-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .appt-dashboard .eu-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .appt-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appt-row-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .appt-filter-grid {
    grid-template-columns: 1fr;
  }

  .appt-dashboard .eu-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .appt-print-title {
    margin-bottom: 12px;
  }

  .appt-table {
    width: 100%;
    font-size: 11px;
  }

  .eu-page-header,
  .sidebar,
  .topbar,
  nav,
  .app-shell__sidebar {
    display: none !important;
  }
}

/* —— Calendar ops strip / chips / detail / quick search —— */
.appt-ops-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.appt-ops-strip__item {
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 56px;
}

.appt-ops-strip__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.appt-ops-strip__value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.appt-ops-strip__item--arrived { border-top: 3px solid #16a34a; }
.appt-ops-strip__item--waiting { border-top: 3px solid #2563eb; }
.appt-ops-strip__item--progress { border-top: 3px solid #d97706; }
.appt-ops-strip__item--cancelled { border-top: 3px solid #dc2626; }
.appt-ops-strip__item--revenue { border-top: 3px solid #0f766e; }

.appt-cal-legend--counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 14px;
  padding: 8px 0;
}

.appt-cal-legend--counts strong { font-weight: 700; }

.appt-quick-search {
  position: relative;
  min-width: 220px;
}

.appt-quick-search__input {
  font-size: 13px;
  min-width: 220px;
  height: var(--eu-field-h-sm, 32px);
  box-sizing: border-box;
}

.appt-quick-search__results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  max-height: 240px;
}

.appt-cal-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.appt-chip {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  background: #f1f5f9;
  color: #475569;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt-chip--uhid { background: #f8fafc; color: #334155; }
.appt-chip--visit { background: #e0f2fe; color: #0369a1; }
.appt-chip--type { background: #f1f5f9; color: #475569; }
.appt-chip--paid { background: #dcfce7; color: #166534; }
.appt-chip--unpaid { background: #fee2e2; color: #991b1b; }
.appt-chip--billed { background: #fef3c7; color: #92400e; }
.appt-chip--corp { background: #ede9fe; color: #5b21b6; }
.appt-chip--vip { background: #fef3c7; color: #b45309; }
.appt-chip--status { background: #e2e8f0; color: #334155; }
.appt-chip--hold { background: #ffedd5; color: #c2410c; }
.appt-hold-badge { margin-left: 0.35rem; }

.appt-booking-type {
  border: 0;
  padding: 0;
  margin: 0 0 0.75rem;
}
.appt-booking-type__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.35rem;
}
.appt-booking-type__option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
}

.appt-cal-card--month .appt-chip {
  font-size: 8px;
  line-height: 14px;
  padding: 0 4px;
}

.appt-cal-card__hit--full { margin-bottom: 6px; }

.appt-detail__section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.appt-detail__section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.appt-detail__name {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.appt-detail__dl {
  margin: 0;
  display: grid;
  gap: 6px;
}

.appt-detail__dl > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 13px;
}

.appt-detail__dl dt { margin: 0; color: #64748b; }
.appt-detail__dl dd { margin: 0; font-weight: 600; }
.appt-detail__muted { margin: 0; font-size: 13px; color: #64748b; }
.appt-detail__alerts { margin: 0; padding-left: 18px; font-size: 13px; color: #b45309; }
.appt-detail__visits { margin: 0; padding-left: 18px; font-size: 13px; }
.appt-detail__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

@media (max-width: 1100px) {
  .appt-ops-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .appt-ops-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.appt-detail__toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -4px 0 14px;
  padding: 10px 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--eu-border, #e2e8f0);
}

.appt-detail__toolbar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}

.appt-detail__actions--toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* —— Daily list: actionable KPIs + primary filters + more menu —— */
a.eu-kpi--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.eu-kpi--link:hover,
a.eu-kpi--link.is-active {
  box-shadow: 0 0 0 2px #2563eb;
  transform: translateY(-1px);
}

.eu-kpi--danger .eu-kpi__value { color: #b91c1c; }

.appt-primary-filters {
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 14px;
}

.appt-primary-filters__search {
  margin-bottom: 12px;
}

.appt-primary-filters__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px 12px;
}

.appt-advanced-filters {
  margin-top: 10px;
}

.appt-advanced-filters > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  list-style: none;
}

.appt-advanced-filters > summary::-webkit-details-marker { display: none; }

.appt-advanced-filters__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 10px;
}

.appt-primary-filters__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.appt-showing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}

.appt-showing__label { font-weight: 600; }

.appt-showing__chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.appt-patient-cell__name {
  font-weight: 600;
}

.appt-patient-cell__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
  font-size: 11px;
  color: #64748b;
}

.appt-patient-cell__meta span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
  color: #cbd5e1;
}

.appt-more {
  position: relative;
  display: inline-block;
}

.appt-more > summary {
  list-style: none;
  cursor: pointer;
}

.appt-more > summary::-webkit-details-marker { display: none; }

.appt-more__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.appt-more__link,
.appt-more__btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
}

.appt-more__link:hover,
.appt-more__btn:hover {
  background: #f1f5f9;
}

.appt-more__form { margin: 0; }

@media (max-width: 1100px) {
  .appt-primary-filters__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .appt-primary-filters__grid,
  .appt-advanced-filters__grid {
    grid-template-columns: 1fr;
  }
}

/* Shared compact KPI summary (daily + weekly) */
.eu-kpi-summary,
.appt-ops-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}

.appt-week .appt-cal-legend--counts {
  margin: 0 0 10px;
  align-items: center;
}

.eu-kpi-summary__item,
a.eu-kpi-summary__item {
  display: block;
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 52px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

a.eu-kpi-summary__item:hover,
a.eu-kpi-summary__item.is-active {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.eu-kpi-summary__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.eu-kpi-summary__value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.eu-kpi-summary__item--arrived { border-top: 3px solid #16a34a; }
.eu-kpi-summary__item--waiting,
.eu-kpi-summary__item--info { border-top: 3px solid #2563eb; }
.eu-kpi-summary__item--progress { border-top: 3px solid #d97706; }
.eu-kpi-summary__item--cancelled { border-top: 3px solid #dc2626; }
.eu-kpi-summary__item--revenue { border-top: 3px solid #0f766e; }

/* Daily / appointment Find panel — dense Search Workbench (shared PEUF classes) */
.appt-quick-filter.eu-search-panel {
  margin: 0 0 12px;
}

.appt-quick-filter.eu-search-panel .eu-card__body {
  /* dense panel padding comes from eu-search-panel--dense */
}

.appt-quick-filter .eu-search-dense__actions .eu-btn {
  white-space: nowrap;
}
