.operations-dashboard,
.operations-schedule,
.attendance-report,
#appointment-dialog {
  --ops-ink: #172338;
  --ops-muted: #526279;
  --ops-line: #e2e8f0;
  --ops-surface: #f5f7fb;
  --ops-accent: #b83c1e;
  --ops-accent-soft: #fff1ec;
}

.operations-dashboard {
  --dashboard-ink: var(--ops-ink);
  --dashboard-muted: var(--ops-muted);
  --dashboard-padding: clamp(13px, 2vw, 20px);
  gap: 17px;
}
.operations-dashboard .dashboard-hero { align-items: center; padding: 0 0 3px; }
.operations-dashboard .dashboard-hero h1 { font-size: clamp(1.85rem, 3.1vw, 2.35rem); line-height: 1.07; }
.operations-dashboard .dashboard-business { color: var(--ops-muted); }
.dashboard-business span { margin: 0 2px; color: #8896a8; }
.dashboard-business time { text-transform: capitalize; }
.dashboard-daily {
  padding: var(--dashboard-padding);
  border: 1px solid var(--ops-line);
  border-radius: var(--radius);
  background: #fff;
}
.dashboard-daily > header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 11px;
}
.dashboard-daily > header h2 { font-size: 1rem; }
.dashboard-daily > header span { color: var(--ops-muted); font-size: .8rem; }
.operations-dashboard .dashboard-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.operations-dashboard .dashboard-metric {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 9px;
  min-height: 68px;
  padding: 9px 11px;
  align-content: center;
  background: var(--ops-surface);
  border: 1px solid var(--ops-line);
  border-radius: 10px;
  box-shadow: none;
}
.operations-dashboard .dashboard-metric:hover { background: #fff; border-color: #c1cbd8; }
.operations-dashboard .dashboard-metric[data-state="total"] { background: var(--ops-accent-soft); border-color: #f3ddd3; }
.operations-dashboard .dashboard-metric-icon { grid-row: 1 / 3; grid-column: 1; width: 34px; height: 34px; }
.operations-dashboard .dashboard-metric-icon svg { width: 17px; height: 17px; }
.operations-dashboard .dashboard-metric-label { grid-row: 2; grid-column: 2; }
.operations-dashboard .dashboard-metric strong { grid-row: 1; grid-column: 2; font-size: 1.38rem; color: var(--ops-ink); }
.operations-dashboard .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; gap: 14px; }
.operations-dashboard .dashboard-section { border-color: var(--ops-line); min-width: 0; box-shadow: none; }
.operations-dashboard .dashboard-section-heading {
  min-height: 67px;
  padding: 10px var(--dashboard-padding);
  border-bottom: 1px solid var(--ops-line);
}
.operations-dashboard .dashboard-section-heading h2 { font-size: 1rem; letter-spacing: -.012em; }
.operations-dashboard .dashboard-section-heading small { color: var(--ops-muted); }
.operations-dashboard .dashboard-link { color: var(--ops-accent); }
.operations-dashboard .dashboard-upcoming { grid-column: 1; grid-row: 1; }
.operations-dashboard .dashboard-inbox { grid-column: 2; grid-row: 1; }
.operations-dashboard .dashboard-week { grid-column: 1; grid-row: 2; }
.operations-dashboard .dashboard-team { grid-column: 2; grid-row: 2; }
.operations-dashboard .dashboard-appointment-list { margin: 0; padding: 0 8px; }
.operations-dashboard .dashboard-appointment {
  grid-template-columns: minmax(4.6rem, auto) minmax(0, 1fr) auto;
  padding: 10px 8px;
  gap: 7px 10px;
  min-height: 66px;
}
.dashboard-slot-time { display: grid; gap: 3px; }
.dashboard-slot-time small { color: var(--ops-muted); font-size: .7rem; }
.operations-dashboard .dashboard-slot-time time { color: var(--ops-ink); font-size: .88rem; }
.operations-dashboard .dashboard-appointment-copy strong { white-space: normal; overflow-wrap: anywhere; }
.operations-dashboard .dashboard-section .empty strong { display: block; color: var(--ops-ink); margin-bottom: 4px; }
.dashboard-priorities { padding: 4px var(--dashboard-padding); }
.dashboard-priority {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--ops-line);
  background: transparent;
  color: var(--ops-ink);
  text-align: left;
  text-decoration: none;
}
.dashboard-priority:last-child { border-bottom: 0; }
.dashboard-priority:hover { color: var(--ops-accent); }
.dashboard-priority > span:first-child { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ops-surface); color: var(--ops-muted); }
.dashboard-priority > span:first-child svg { width: 16px; height: 16px; }
.dashboard-priority small { display: block; margin-top: 2px; font-size: .75rem; color: var(--ops-muted); }
.operations-dashboard .dashboard-team-row > strong { color: var(--ops-ink); }
.dashboard-week-total { white-space: nowrap; color: var(--ops-ink); font-size: 1.08rem; }
.operations-dashboard .dashboard-week-total small { display: inline; }
.operations-dashboard .dashboard-week-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 9px var(--dashboard-padding) 12px;
}
.operations-dashboard .dashboard-week-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 5px;
  min-height: 116px;
  padding: 5px 2px;
  border-radius: 7px;
}
.operations-dashboard .dashboard-week-row[aria-current="date"] { background: var(--ops-accent-soft); color: var(--ops-accent); }
.dashboard-week-row time { text-transform: capitalize; }
.dashboard-bar { display: grid; place-items: center; width: 100%; height: 68px; }
.operations-dashboard .dashboard-bar progress {
  width: 66px;
  height: 16px;
  margin: 0 calc((16px - 66px) / 2);
  transform: rotate(-90deg);
  accent-color: var(--ops-accent);
}
.operations-dashboard .dashboard-bar progress::-webkit-progress-bar { background: #e8edf4; }
.operations-dashboard .dashboard-bar progress::-webkit-progress-value { background: #bd482c; }
.operations-dashboard .dashboard-bar progress::-moz-progress-bar { background: #bd482c; }

.operations-schedule { overflow: hidden; }
.operations-schedule .agenda-toolbar { display: flex; flex-wrap: wrap; padding: 11px 15px; gap: 10px; }
.agenda-period { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agenda-period > time { font-weight: 750; color: var(--ops-ink); text-transform: capitalize; }
.agenda-period .date-controls { flex: none; gap: 2px; }
.operations-schedule .agenda-period .icon-button { padding: 0; min-width: 36px; min-height: 38px; border: 1px solid var(--ops-line); }
.operations-schedule .agenda-today { min-height: 38px; }
.operations-schedule .agenda-view-switch { margin-left: auto; background: var(--ops-surface); border-color: var(--ops-line); }
.operations-schedule .agenda-view-option[aria-pressed="true"] { color: var(--ops-accent); border-color: var(--ops-line); }
.agenda-query { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; padding: 0 15px 11px; border-bottom: 1px solid var(--ops-line); }
.operations-schedule .agenda-search { position: relative; width: min(100%, 35rem); align-self: start; }
.operations-schedule .agenda-query .agenda-search { width: min(calc(100% - 115px), 35rem); }
.agenda-search svg { position: absolute; inset-inline-start: 10px; color: var(--ops-muted); pointer-events: none; }
.operations-schedule .agenda-search input { width: 100%; max-width: none; min-height: 42px; padding-inline-start: 37px; border-color: var(--ops-line); }
.operations-schedule .agenda-search:has(.agenda-search-clear:not([hidden])) input { padding-inline-end: 46px; }
.operations-schedule .agenda-search-clear { position: absolute; inset-inline-end: 1px; width: 44px; min-height: 40px; padding: 0; border: 0; background: transparent; font-size: 1.25rem; }
.operations-schedule .agenda-query .agenda-filters { display: block; padding: 0; border: 0; }
.operations-schedule .agenda-query .agenda-filters:not([open]) { height: 0; margin-top: -8px; }
.operations-schedule .agenda-filter-details > summary {
  position: absolute;
  top: 0;
  inset-inline-end: 15px;
  display: list-item;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--ops-line);
  border-radius: 8px;
  color: var(--ops-ink);
  background: var(--ops-surface);
  white-space: nowrap;
}
.operations-schedule .agenda-filter-details > summary:hover { background: #ebf0f8; }
.operations-schedule .agenda-filter-details:not([open]) .agenda-filter-options { display: none; }
.operations-schedule .agenda-filter-options {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--ops-line);
  border-radius: 9px;
  background: var(--ops-surface);
}
.operations-schedule .agenda-filter-field { width: 100%; min-width: 0; }
.operations-schedule .agenda-filter-field :is(input, select) { min-height: 40px; border-color: var(--ops-line); }
.operations-schedule .agenda-week { gap: 4px; padding: 7px 15px; background: #fff; }
.operations-schedule .agenda-week-day { min-height: 61px; gap: 2px; padding: 4px 3px; border: 1px solid transparent; }
.operations-schedule .agenda-week-day[aria-current="date"]:not([aria-pressed="true"]) { border-color: #edc4b6; }
.operations-schedule .agenda-week-day[aria-pressed="true"],
.operations-schedule[data-view-mode="day"] .agenda-week-day[aria-pressed="true"] { background: var(--ops-accent-soft); color: #942e17; border-color: #ecc9be; }
.operations-schedule .agenda-week-count { display: block; height: 11px; visibility: hidden; line-height: 1; }
.operations-schedule .agenda-week-count[data-has-bookings] { visibility: visible; }
.agenda-legend { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 8px 15px; border-bottom: 1px solid var(--ops-line); color: var(--ops-muted); font-size: .78rem; }
.agenda-legend ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.agenda-legend .pill { font-size: .7rem; padding: 3px 7px; }
.operations-schedule .calendar { --calendar-grid-line: var(--ops-line); }
.operations-schedule[data-view-mode="day"] .calendar-day { --calendar-grid-line: var(--ops-line); --calendar-hour-size: 110px; }
.operations-schedule .calendar-day-head { position: relative; min-height: 46px; }
.operations-schedule .calendar-day-count { position: absolute; inset: 5px 5px auto auto; color: var(--ops-muted); font-size: .66rem; }
.operations-schedule .calendar-day .calendar-body {
  display: block;
  position: relative;
  background: linear-gradient(to right, var(--ops-surface) var(--calendar-time-size), white var(--calendar-time-size));
}
.operations-schedule .calendar-day .calendar-times {
  position: absolute;
  inset: 0;
  height: auto;
  border: 0;
  background: transparent;
}
.operations-schedule .calendar-day .calendar-time span {
  display: block;
  width: calc(var(--calendar-time-size) - 4px);
}
.operations-schedule .calendar-day .calendar-column {
  height: calc(var(--day-minutes) * var(--calendar-hour-size) / 60);
  margin-inline-start: var(--calendar-time-size);
  border-inline-start: 1px solid var(--calendar-grid-line);
  background: transparent;
}
.operations-schedule .calendar-time { color: var(--ops-muted); }
.operations-schedule .calendar-day .calendar-event { border-radius: 7px; }
.operations-schedule .calendar-day .calendar-event-band { background: transparent; padding-block: 4px 1px; }
.operations-schedule .calendar-day .calendar-event-status { font-weight: 700; }
.operations-schedule .calendar-day .calendar-client { font-size: .86rem; }
.operations-schedule .calendar-day .calendar-event-detail { font-size: .76rem; }
.operations-schedule .agenda-empty-state { padding: 28px 16px; color: var(--ops-muted); }
.agenda-empty-state strong { display: block; margin-bottom: 4px; color: var(--ops-ink); }
.operations-schedule .agenda-desktop td small { display: block; margin-top: 3px; color: var(--ops-muted); }
.operations-schedule .agenda-desktop .client strong { overflow-wrap: anywhere; }
.operations-schedule .agenda-desktop td:first-child strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

.attendance-report { color: var(--ops-ink); }
.attendance-report .attendance-filters { grid-template-columns: minmax(0, 1fr) minmax(125px, .75fr) minmax(150px, 1fr); align-items: center; }
.attendance-period-context { display: grid; gap: 4px; }
.attendance-period-context small { color: var(--ops-muted); }
.attendance-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .9fr); gap: 14px; align-items: start; }
.attendance-patterns, .attendance-overview { min-width: 0; overflow: hidden; }
.attendance-report :is(.attendance-patterns, .attendance-overview) > header { padding: 14px 16px; border-bottom: 1px solid var(--ops-line); }
.attendance-report :is(.attendance-patterns, .attendance-overview) > header p { margin-top: 4px; color: var(--ops-muted); font-size: .83rem; }
.attendance-report .attendance-patterns tbody th { text-align: start; font-size: .84rem; text-transform: capitalize; }
.attendance-patterns th time { display: block; margin-top: 3px; color: var(--ops-muted); font-weight: 500; }
.attendance-rate { display: grid; grid-template-columns: 3.8em minmax(30px, 1fr); align-items: center; gap: 6px; white-space: nowrap; }
.attendance-rate progress { width: 100%; height: 6px; accent-color: var(--ops-accent); }
.attendance-report .attendance-patterns .empty { padding: 20px 16px; }
.attendance-report .attendance-patterns .empty strong { display: block; margin-bottom: 5px; color: var(--ops-ink); }
.attendance-lead { display: grid; gap: 4px; padding: 14px 16px; background: var(--ops-surface); }
.attendance-lead span { color: var(--ops-muted); font-size: .8rem; }
.attendance-lead strong { font-size: 1.85rem; line-height: 1; font-variant-numeric: tabular-nums; }
.attendance-lead small { margin-top: 4px; color: var(--ops-muted); }
.attendance-report .attendance-summary { display: block; margin: 0; padding: 2px 16px; }
.attendance-report .attendance-summary > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--ops-line); }
.attendance-report .attendance-summary > div:last-child { border-bottom: 0; }
.attendance-report .attendance-summary dd { margin: 0; font-size: 1rem; font-variant-numeric: tabular-nums; }
.attendance-report .attendance-summary dt { color: var(--ops-muted); }

#appointment-dialog {
  width: min(calc(100% - 26px), 570px);
  max-height: min(90dvh, 840px);
  padding: 0;
  overflow: auto;
}
#appointment-form { gap: 12px; padding: 0 14px; }
#appointment-form > .dialog-heading {
  position: sticky;
  z-index: 2;
  top: 0;
  margin-inline: -14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ops-line);
  background: white;
}
.appointment-form-group {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 9px 12px 11px;
  border: 1px solid var(--ops-line);
  border-radius: 9px;
}
.appointment-form-group legend { padding-inline: 5px; color: var(--ops-ink); font-size: .87rem; font-weight: 750; }
.appointment-form-group > .appointment-series { background: var(--ops-surface); }
#appointment-form > .appointment-payment { padding: 10px 12px; border: 1px solid var(--ops-line); border-radius: 9px; background: var(--ops-surface); }
.appointment-form-actions {
  position: sticky;
  z-index: 1;
  bottom: 0;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 6px;
  margin: 0 -14px;
  padding: 9px 14px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--ops-line);
  background: white;
}
.appointment-form-actions .error { grid-column: 1 / -1; }

@media (max-width: 940px) {
  .operations-dashboard .dashboard-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .operations-dashboard .dashboard-metric-icon { width: 28px; height: 28px; }
  .operations-dashboard .dashboard-metric { padding-inline: 7px; gap: 3px 5px; }
  .operations-schedule .agenda-filter-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operations-schedule .agenda-filter-reset { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 800px) {
  .operations-schedule .agenda-period .icon-button, .operations-schedule .agenda-today { min-width: 44px; min-height: 44px; }
  .operations-schedule .agenda-toolbar, .agenda-query, .agenda-legend { padding-inline: 9px; }
  .operations-schedule .agenda-filter-details > summary { inset-inline-end: 9px; }
  .operations-schedule .agenda-week { padding-inline: 7px; }
  .operations-schedule .agenda-filter-details > summary, .operations-schedule .agenda-search input { min-height: 44px; }
  .operations-schedule .agenda-search-clear { min-height: 44px; }
  .operations-schedule .agenda-mobile { padding: 0 9px; }
  .operations-schedule .agenda-entry {
    display: grid;
    grid-template-columns: minmax(44px, auto) minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding: 10px 0;
    border-bottom-color: var(--ops-line);
  }
  .agenda-entry-slot { display: grid; gap: 3px; color: var(--ops-muted); font-size: .72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .agenda-entry-slot time { font-size: .86rem; font-weight: 750; color: var(--ops-ink); }
  .operations-schedule .agenda-entry-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; font-size: .82rem; overflow-wrap: anywhere; }
  .agenda-entry-status { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
  .agenda-entry-status .attendance-badge { margin: 0; }
  .operations-schedule .agenda-entry-actions { grid-column: 3; grid-row: 1; flex-direction: column; align-items: stretch; gap: 4px; }
  .operations-schedule .agenda-entry-actions .secondary { padding-inline: 7px; }
}
@media (max-width: 580px) {
  .operations-dashboard .dashboard-hero-actions { width: 100%; }
  .operations-dashboard .dashboard-hero-actions .dashboard-primary { margin-inline-start: auto; }
  .operations-dashboard .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-dashboard .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .operations-dashboard .dashboard-grid > * { grid-row: auto; grid-column: auto; }
  .operations-dashboard .dashboard-appointment { grid-template-columns: 3.65rem minmax(0, 1fr); }
  .operations-dashboard .dashboard-appointment .pill { grid-column: 2; justify-self: start; }
  .agenda-period { flex: 1 1 100%; gap: 5px; }
  .agenda-period > time { font-size: .86rem; flex: 1 1 auto; overflow-wrap: anywhere; }
  .operations-schedule .agenda-view-switch { width: 100%; margin-inline-start: 0; }
  .operations-schedule .agenda-view-option { flex: 1; }
  .operations-schedule .agenda-filter-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-schedule .agenda-filter-field:first-child { grid-column: 1 / -1; }
  .operations-schedule .agenda-legend { align-items: start; }
  .operations-schedule .agenda-entry:has(.agenda-confirm) .agenda-entry-actions { grid-column: 2 / -1; grid-row: 2; justify-content: start; }
  .attendance-report .attendance-filters { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 8px; padding: 10px; }
  .attendance-period-context { grid-column: 1 / -1; }
  .attendance-layout { grid-template-columns: minmax(0, 1fr); }
  .attendance-overview { grid-row: 1; }
  .attendance-report .attendance-patterns :is(td, th) { padding-inline: 8px; font-size: .79rem; }
  .attendance-rate { grid-template-columns: auto; gap: 4px; }
  .attendance-rate progress { width: 50px; max-width: 100%; }
}
