/* Staff & mobile-friendly enhancements — additive only */

/* Staff mobile menu: match native admin dark menu (no custom white panel) */
@media (max-width: 768px) {
  body.echurch-staff-mode .mobile-menu.echurch-staff-mobile-panel,
  body.echurch-staff-mode .mobile-menu {
    background-color: rgb(var(--color-primary) / 0.9) !important;
  }
  body.echurch-staff-mode .mobile-menu .scrollable {
    background-color: #103d4d !important;
  }
  body.echurch-staff-mode .mobile-menu .mobile-menu-bar {
    background: transparent !important;
  }
  body.echurch-staff-mode .mobile-menu .echurch-mobile-nav-header,
  body.echurch-staff-mode .mobile-menu .echurch-staff-menu-header {
    display: none !important;
  }
  body.echurch-staff-mode .mobile-menu a.menu {
    display: flex !important;
    min-height: 50px;
    touch-action: manipulation;
  }
  body.echurch-staff-mode .mobile-menu #echurch-my-assignments-mobile-native .menu__title {
    font-weight: 700;
  }
  .echurch-mobile-nav-header { display: none !important; }
}

/* ── Mobile menu: larger tap targets for staff (legacy hooks) ── */
@media (max-width: 768px) {
  body.echurch-staff-mode .mobile-menu a,
  body.echurch-staff-mode .mobile-menu li a {
    display: block;
    padding: 14px 16px !important;
    font-size: 15px !important;
    font-weight: 600;
  }
  body.echurch-staff-mode .mobile-menu ul {
    padding-bottom: 12px;
  }

  /* Search & filter bar */
  body.echurch-staff-mode input[placeholder="Search..."],
  body.echurch-staff-mode input[placeholder*="Search"] {
    font-size: 16px !important;
    min-height: 44px;
    padding: 10px 12px !important;
  }
  body.echurch-staff-mode button {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Member cards in list */
  body.echurch-staff-mode .cursor-pointer.hover\:shadow-lg,
  body.echurch-staff-mode .hover\:shadow-lg.transition-shadow {
    padding: 14px !important;
    margin-bottom: 10px;
  }

  /* Toasts on mobile */
  .echurch-pending-toast-mobile {
    left: 12px !important;
    right: 12px !important;
    max-width: none !important;
    top: auto !important;
    bottom: 16px !important;
  }
}

/* ── Staff work status badges (member list + profile) ── */
.ech-work-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.ech-work-updated { background: #dcfce7; color: #166534; }
.ech-work-pending { background: #ffedd5; color: #9a3412; }
.ech-work-remaining { background: #fee2e2; color: #991b1b; }

.ech-staff-profile-banner {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.ech-staff-profile-banner.ech-work-updated { border-left: 4px solid #22c55e; }
.ech-staff-profile-banner.ech-work-pending { border-left: 4px solid #f59e0b; }
.ech-staff-profile-banner.ech-work-remaining { border-left: 4px solid #ef4444; }
.ech-staff-profile-banner__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 4px;
}
.ech-staff-profile-banner__status {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}
.ech-staff-profile-banner__hint {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 8px;
}
.ech-staff-profile-banner__link {
  font-size: 13px;
  font-weight: 600;
  color: #164e63;
  text-decoration: none;
}
.ech-staff-profile-banner__link:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .ech-staff-profile-banner {
    margin: 10px 0 14px;
    padding: 12px 14px;
  }
  .ech-staff-profile-banner__status { font-size: 16px; }

  /* Profile edit forms — usable Save/Cancel on touch devices */
  body.echurch-staff-mode .max-w-6xl button,
  body.echurch-staff-mode .ant-tabs-content button {
    touch-action: manipulation;
  }
  body.echurch-staff-mode .max-w-6xl form button[type="button"],
  body.echurch-staff-mode .max-w-6xl form button[type="submit"],
  body.echurch-staff-mode .ant-tabs-content form button {
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
  }
  body.echurch-staff-mode .max-w-6xl input,
  body.echurch-staff-mode .max-w-6xl select,
  body.echurch-staff-mode .max-w-6xl textarea,
  body.echurch-staff-mode .ant-tabs-content input,
  body.echurch-staff-mode .ant-tabs-content select,
  body.echurch-staff-mode .ant-tabs-content textarea {
    font-size: 16px;
    min-height: 44px;
  }
}

/* ── Profile section injection (inside collapse panels) ── */
.echurch-spouse-injected-panel {
  padding: 0.25rem 0 0.5rem;
}
.echurch-spouse-injected-panel .echurch-spouse-card__body {
  padding: 0.75rem 0 0;
}

/* ── Children patch mobile ── */
@media (max-width: 768px) {
  #echurch-children-enhanced {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }
  .echurch-children-section-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 0.75rem;
    scrollbar-width: none;
  }
  .echurch-children-section-tabs::-webkit-scrollbar { display: none; }
  .echurch-children-section-tabs button {
    flex: 0 0 auto;
    padding: 0.55rem 1rem;
    font-size: 0.8125rem;
    min-height: 44px;
  }
  .echurch-children-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
  }
  .echurch-children-table {
    min-width: 640px;
  }
  .echurch-children-actions button {
    min-height: 40px;
    min-width: 72px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  .echurch-profile-children-block .echurch-children-table {
    min-width: 560px;
  }
  .echurch-profile-children-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  #echurch-child-edit-modal {
    align-items: flex-end;
    padding: 0;
  }
  #echurch-child-edit-modal .echurch-child-modal-box {
    max-width: none;
    width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
  .echurch-child-modal-body input,
  .echurch-child-modal-body select {
    font-size: 16px;
    min-height: 44px;
  }
  .echurch-child-modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .echurch-child-modal-footer button {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
  }
  .echurch-child-promote-banner {
    font-size: 0.8125rem;
    line-height: 1.45;
  }
}

/* ── Spouse / profile modals on mobile ── */
@media (max-width: 768px) {
  .echurch-spouse-card__body,
  .echurch-spouse-card__header {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .echurch-spouse-row {
    flex-direction: column;
    gap: 0.35rem;
  }
  [id^="echurch-marital-manage-"] button,
  .echurch-spouse-injected-panel button,
  .echurch-spouse-card button {
    min-height: 44px;
    width: 100%;
    margin-top: 6px;
  }
}

/* ── Staff assignments page (also in staff-assignments.html inline) ── */
@media (max-width: 768px) {
  .sa-card-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
  .sa-member-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
  }
  .sa-member-card.row-assigned { border-left: 4px solid #22c55e; background: #f0fdf4; }
  .sa-member-card.row-unassigned { border-left: 4px solid #f59e0b; background: #fffbeb; }
  .sa-member-card__name { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0 0 6px; }
  .sa-member-card__meta { font-size: 13px; color: #64748b; margin-bottom: 4px; word-break: break-all; }
  .sa-member-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
  .sa-member-card__check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-height: 44px; }
  .sa-member-card__check input { width: 20px; height: 20px; }
  .sa-open-btn {
    flex: 1;
    min-height: 44px;
    background: #164e63;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
  }
  .sa-sticky-assign {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.1);
    flex-wrap: wrap;
    align-items: center;
  }
  .sa-sticky-assign .sa-select { flex: 1; min-width: 0; min-height: 44px; font-size: 16px; }
  .sa-sticky-assign .sa-btn-primary { flex: 1; min-height: 48px; font-size: 15px; }
  body.is-admin.has-sticky-assign { padding-bottom: 140px; }
}

@media (min-width: 769px) {
  .sa-card-list,
  .sa-sticky-assign { display: none !important; }
}
