/* Scheduling, CRM detail, PWA — extends admin design system */

.admin-search { flex: 1; max-width: 360px; min-width: 0; }
.admin-search__input { width: 100%; }

.admin-topbar__collapse { display: none; }
@media (min-width: 1024px) {
  .admin-topbar__collapse { display: inline-flex; }
}

.admin-shell--collapsed { --adm-sidebar-width: 76px; }
.admin-shell--collapsed [data-sidebar-label] { display: none; }
.admin-shell--collapsed .admin-sidebar__link { justify-content: center; }
.admin-shell--collapsed .admin-sidebar__brand { justify-content: center; padding-inline: var(--adm-space-3); }

.admin-topbar__notify {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--adm-radius-md);
  color: var(--adm-muted);
  transition: background var(--adm-duration) var(--adm-ease);
}
.admin-topbar__notify:hover { background: var(--adm-surface-muted); color: var(--adm-text); }
.admin-topbar__notify-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: var(--adm-weight-semibold);
  line-height: 18px;
  text-align: center;
  border-radius: var(--adm-radius-full);
  background: var(--adm-primary);
  color: #fff;
}

.admin-profile {
  display: inline-flex;
  align-items: center;
  gap: var(--adm-space-2);
  padding: var(--adm-space-1) var(--adm-space-2);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-full);
  background: var(--adm-surface);
  cursor: pointer;
  font: inherit;
}
.admin-profile__name {
  font-size: var(--adm-text-sm);
  font-weight: var(--adm-weight-medium);
  color: var(--adm-text);
}
@media (max-width: 640px) {
  .admin-profile__name { display: none; }
  .admin-search { max-width: 140px; }
}

.view-tabs {
  display: flex;
  gap: var(--adm-space-2);
  margin-bottom: var(--adm-space-6);
  flex-wrap: wrap;
}
.view-tabs a,
.view-tabs button {
  padding: var(--adm-space-2) var(--adm-space-4);
  font-size: var(--adm-text-sm);
  font-weight: var(--adm-weight-medium);
  color: var(--adm-muted);
  border-radius: var(--adm-radius-md);
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.view-tabs a:hover,
.view-tabs button:hover { color: var(--adm-text); background: var(--adm-surface-muted); }
.view-tabs a.is-active,
.view-tabs button.is-active {
  color: var(--adm-primary);
  background: var(--adm-primary-soft);
  border-color: transparent;
}

.bookings-views[data-tabs] .bookings-view-panel {
  display: none;
}
.bookings-views[data-tabs] .bookings-view-panel.is-active {
  display: block;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--adm-border);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-lg);
  overflow: hidden;
}
.calendar__head {
  background: var(--adm-surface-muted);
  padding: var(--adm-space-3);
  font-size: var(--adm-text-xs);
  font-weight: var(--adm-weight-medium);
  text-align: center;
  color: var(--adm-muted);
}
.calendar__cell {
  min-height: 88px;
  background: var(--adm-surface);
  padding: var(--adm-space-2);
  vertical-align: top;
}
.calendar__date {
  font-size: var(--adm-text-xs);
  color: var(--adm-muted);
  margin-bottom: var(--adm-space-1);
}
.calendar__event {
  display: block;
  font-size: 0.68rem;
  padding: 2px 4px;
  margin-bottom: 2px;
  border-radius: 4px;
  background: var(--adm-primary-soft);
  color: var(--adm-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.calendar__event:hover {
  background: var(--adm-primary);
  color: #fff;
}
.timeline__title a {
  color: inherit;
  text-decoration: none;
}
.timeline__title a:hover {
  color: var(--adm-primary);
  text-decoration: underline;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--adm-border);
  margin-left: var(--adm-space-3);
}
.timeline__item {
  position: relative;
  padding: var(--adm-space-4) 0 var(--adm-space-4) var(--adm-space-6);
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--adm-space-3) - 5px);
  top: var(--adm-space-5);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--adm-primary);
}
.timeline__time {
  font-size: var(--adm-text-xs);
  color: var(--adm-muted);
}
.timeline__title {
  font-weight: var(--adm-weight-medium);
  margin-top: var(--adm-space-1);
}

.detail-grid {
  display: grid;
  gap: var(--adm-space-6);
}
@media (min-width: 960px) {
  .detail-grid { grid-template-columns: 1fr 320px; }
}

.detail-tabs {
  display: flex;
  gap: var(--adm-space-4);
  border-bottom: 1px solid var(--adm-border);
  margin-bottom: var(--adm-space-6);
}
.detail-tabs a {
  padding: var(--adm-space-3) 0;
  font-size: var(--adm-text-sm);
  font-weight: var(--adm-weight-medium);
  color: var(--adm-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.detail-tabs a.is-active {
  color: var(--adm-primary);
  border-bottom-color: var(--adm-primary);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--adm-space-3);
  margin-bottom: var(--adm-space-6);
  align-items: flex-end;
}
.filter-bar .field { min-width: 140px; }

.settings-layout {
  display: grid;
  gap: var(--adm-space-6);
}
@media (min-width: 900px) {
  .settings-layout { grid-template-columns: 220px 1fr; }
}
.settings-nav a {
  display: block;
  padding: var(--adm-space-3) var(--adm-space-4);
  font-size: var(--adm-text-sm);
  color: var(--adm-text-secondary);
  border-radius: var(--adm-radius-md);
}
.settings-nav a:hover { background: var(--adm-surface-muted); }
.settings-nav a.is-active {
  background: var(--adm-primary-soft);
  color: var(--adm-primary);
  font-weight: var(--adm-weight-medium);
}

/* Staff PWA */
.pwa-body {
  margin: 0;
  font-family: var(--adm-font, "Inter", system-ui, sans-serif);
  background: var(--adm-bg, #f6f3ee);
  color: var(--adm-text, #17202a);
  min-height: 100dvh;
}
.pwa-header {
  padding: var(--adm-space-5);
  background: var(--adm-surface, #fff);
  border-bottom: 1px solid var(--adm-border, #e8e2d9);
}
.pwa-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}
.pwa-main { padding: var(--adm-space-5); max-width: 480px; margin: 0 auto; }
.pwa-card {
  background: #fff;
  border: 1px solid #e8e2d9;
  border-radius: 14px;
  padding: var(--adm-space-5);
  margin-bottom: var(--adm-space-4);
  box-shadow: 0 1px 3px rgba(23, 32, 42, 0.06);
}
.pwa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-bottom: var(--adm-space-3);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}
.pwa-btn--primary { background: #2f7d64; color: #fff; }
.pwa-btn--secondary { background: #f6f3ee; color: #17202a; border: 1px solid #e8e2d9; }
.pwa-btn.gps-btn--active {
  background: #2f7d64;
  color: #fff;
  border-color: #2f7d64;
}
.gps-status {
  margin: -4px 0 var(--adm-space-3);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  text-align: center;
  color: #5c6b7a;
  background: #f6f3ee;
  border: 1px solid #e8e2d9;
}
.gps-status--active {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}
.gps-hint {
  margin: 0 0 var(--adm-space-3);
  line-height: 1.45;
}
.pwa-list { list-style: none; padding: 0; margin: 0; }
.pwa-list li { margin-bottom: var(--adm-space-3); }
.pwa-list a,
.pwa-list__link {
  display: flex;
  align-items: center;
  gap: var(--adm-space-4);
  padding: var(--adm-space-5);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8e2d9;
  color: #17202a;
  text-decoration: none;
  font-weight: 500;
}
.pwa-list__body {
  flex: 1;
  min-width: 0;
}
.pwa-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--adm-space-4);
}
.pwa-header__profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pwa-header__profile-name {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  max-width: 72px;
  text-align: center;
  line-height: 1.2;
}

.pwa-legal-footer,
.cp-footer {
  margin-top: var(--adm-space-6);
  padding: var(--adm-space-4) 0;
  font-size: var(--adm-text-sm);
  text-align: center;
}
.pwa-legal-footer a,
.cp-footer a {
  color: var(--adm-muted);
  text-decoration: none;
}
.pwa-legal-footer a:hover,
.cp-footer a:hover {
  color: var(--adm-primary);
  text-decoration: underline;
}
.admin-sidebar__meta-legal {
  margin: 6px 0 0;
  font-size: var(--adm-text-xs);
}
.admin-sidebar__meta-legal a {
  color: var(--adm-muted);
  text-decoration: none;
}
.admin-sidebar__meta-legal a:hover {
  color: var(--adm-primary);
}
.pwa-body--job .pwa-legal-footer {
  margin-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
.pwa-flash {
  padding: var(--adm-space-4);
  background: #ecfdf3;
  color: #067647;
  border-radius: 10px;
  margin-bottom: var(--adm-space-4);
  font-size: 0.9rem;
}
.pwa-card__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}
.pwa-card--notes {
  border-color: #fbbf24;
  background: #fffbeb;
}
.pwa-card--notes-pulse {
  animation: pwa-notes-glow 2.2s ease-in-out infinite;
}
.pwa-card__title--alert {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b45309;
}
.pwa-card__title--alert::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.65);
  animation: pwa-notes-dot 2.2s ease-in-out infinite;
}
@keyframes pwa-notes-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35), 0 1px 3px rgba(23, 32, 42, 0.06);
    border-color: #fbbf24;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0), 0 0 18px rgba(251, 191, 36, 0.45);
    border-color: #f59e0b;
  }
}
@keyframes pwa-notes-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.65); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}
.pwa-visit-box {
  padding: 0;
  overflow: hidden;
}
.pwa-visit-box__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--adm-space-3);
  width: 100%;
  margin: 0;
  padding: var(--adm-space-5);
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.pwa-visit-box__toggle-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pwa-visit-box__pet {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.pwa-visit-box__meta {
  font-size: 0.8125rem;
  color: #5c6b7a;
  text-transform: capitalize;
}
.pwa-visit-box__chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid #5c6b7a;
  border-bottom: 2px solid #5c6b7a;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -4px;
}
.pwa-visit-box.is-collapsed .pwa-visit-box__chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.pwa-visit-box__body {
  padding: 0 var(--adm-space-5) var(--adm-space-5);
  border-top: 1px solid #f0ebe3;
}
.pwa-visit-box.is-collapsed .pwa-visit-box__body {
  display: none;
}
.pwa-visit-box__row {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.pwa-visit-box__row:last-child {
  margin-bottom: 0;
}
.pwa-visit-box__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c6b7a;
  margin-bottom: 2px;
}
.pwa-note-box {
  margin: var(--adm-space-4) 0 var(--adm-space-3);
  padding: var(--adm-space-4);
  background: #fff;
  border: 1px solid #e8e2d9;
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(23, 32, 42, 0.04);
}
.pwa-note-box__label {
  display: block;
  margin-bottom: var(--adm-space-3);
  font-size: 0.875rem;
  font-weight: 600;
  color: #17202a;
}
.pwa-note-box__input {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: #17202a;
  background: #f6f3ee;
  border: 1px solid #d8d0c4;
  border-radius: 10px;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.pwa-note-box__input::placeholder {
  color: #8a9aa8;
}
.pwa-note-box__input:focus {
  outline: none;
  background: #fff;
  border-color: #2f7d64;
  box-shadow: 0 0 0 3px rgba(47, 125, 100, 0.15);
}
.pwa-job-notes {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #17202a;
  white-space: pre-wrap;
}
.pwa-list__note-hint {
  display: inline-block;
  margin-top: 6px;
  color: #2f7d64;
  font-weight: 500;
}
.pwa-field { width: 100%; margin-top: 8px; }
.pwa-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--adm-space-3);
}
.pwa-media-item img,
.pwa-media-item video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e8e2d9;
  background: #f6f3ee;
}
.pwa-media-item video { object-fit: contain; }
