/* MFV Provider Pages — Inbox / Notifications Styles */

.mfv-inbox {
  max-width: 780px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Header                                                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__header {
  margin-bottom: 20px;
}
.mfv-inbox__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Tabs                                                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 20px;
}
.mfv-inbox__tab {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.mfv-inbox__tab:hover {
  color: var(--mfv-primary, #0e7490);
}
.mfv-inbox__tab--active {
  color: var(--mfv-primary, #0e7490);
  border-bottom-color: var(--mfv-primary, #0e7490);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Toolbar                                                                   */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
}
.mfv-inbox__select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #6b7280;
  cursor: pointer;
}
.mfv-inbox__select-all input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--mfv-primary, #0e7490);
}
.mfv-inbox__toolbar-actions {
  display: flex;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Message / Notification Row                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__list {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.mfv-inbox__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.mfv-inbox__row:last-child {
  border-bottom: none;
}
.mfv-inbox__row:hover {
  background: #f9fafb;
}
.mfv-inbox__row--unread {
  background: #f0f9ff;
}
.mfv-inbox__row--unread:hover {
  background: #e0f2fe;
}
.mfv-inbox__row--unread .mfv-inbox__sender {
  font-weight: 700;
}
.mfv-inbox__row--unread .mfv-inbox__label {
  font-weight: 600;
  color: #111827;
}

/* Checkbox in message rows */
.mfv-inbox__checkbox {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.mfv-inbox__checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--mfv-primary, #0e7490);
  cursor: pointer;
}

/* Link wrapper in message rows */
.mfv-inbox__row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

/* Notification icon */
.mfv-inbox__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.mfv-inbox__row--unread .mfv-inbox__icon {
  background: #e0f2fe;
  color: var(--mfv-primary, #0e7490);
}

/* Row body (notification view) */
.mfv-inbox__row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Unread dot */
.mfv-inbox__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mfv-inbox__dot--unread {
  background: var(--mfv-primary, #0e7490);
}

/* Sender name */
.mfv-inbox__sender {
  width: 140px;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Label text (notification view) */
.mfv-inbox__label {
  flex: 1;
  font-size: 0.88rem;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Detail sub-line (visible on mobile & desktop for moderation etc.) */
.mfv-inbox__detail-line {
  display: block;
  width: 100%;
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* When detail-line is present, stack label + detail vertically */
.mfv-inbox__row-body:has(.mfv-inbox__detail-line) {
  flex-wrap: wrap;
}
.mfv-inbox__row-body:has(.mfv-inbox__detail-line) .mfv-inbox__label {
  width: 100%;
  flex: none;
}

/* Preview text (message view) */
.mfv-inbox__preview {
  flex: 1;
  font-size: 0.88rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Time */
.mfv-inbox__time {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #9ca3af;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Empty State                                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}
.mfv-inbox__empty svg {
  margin-bottom: 16px;
}
.mfv-inbox__empty p {
  margin: 0;
  font-size: 1rem;
  color: #6b7280;
}
.mfv-inbox__empty-sub {
  font-size: 0.85rem !important;
  color: #9ca3af !important;
  margin-top: 6px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Buttons                                                                   */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: #374151;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.3;
}
.mfv-inbox__btn:hover {
  border-color: var(--mfv-primary, #0e7490);
  color: var(--mfv-primary, #0e7490);
}
.mfv-inbox__btn--primary {
  background: var(--mfv-primary, #0e7490);
  color: #fff;
  border-color: var(--mfv-primary, #0e7490);
}
.mfv-inbox__btn--primary:hover {
  background: #0c5e73;
  border-color: #0c5e73;
  color: #fff;
}
.mfv-inbox__btn--danger:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Message Detail                                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--mfv-primary, #0e7490);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 20px;
}
.mfv-inbox__back:hover {
  text-decoration: underline;
}

.mfv-inbox__detail-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.mfv-inbox__detail-sender {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mfv-inbox__detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mfv-primary, #0e7490), #0891b2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.mfv-inbox__detail-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px;
}
.mfv-inbox__detail-meta {
  font-size: 0.82rem;
  color: #9ca3af;
}

.mfv-inbox__detail-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.mfv-inbox__detail-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 0.82rem;
  color: #374151;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.mfv-inbox__detail-pill:hover {
  border-color: var(--mfv-primary, #0e7490);
  color: var(--mfv-primary, #0e7490);
}
.mfv-inbox__detail-pill svg {
  color: #9ca3af;
}

.mfv-inbox__detail-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #374151;
  white-space: pre-wrap;
  padding: 20px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #f3f4f6;
  margin-bottom: 20px;
}

.mfv-inbox__detail-actions {
  display: flex;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Pagination                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}
.mfv-inbox__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #374151;
  text-decoration: none;
  transition: all 0.15s;
}
.mfv-inbox__page:hover {
  border-color: var(--mfv-primary, #0e7490);
  color: var(--mfv-primary, #0e7490);
}
.mfv-inbox__page--active {
  background: var(--mfv-primary, #0e7490);
  color: #fff;
  border-color: var(--mfv-primary, #0e7490);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Settings                                                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__settings-group {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f3f4f6;
}
.mfv-inbox__settings-group:last-of-type {
  border-bottom: none;
}
.mfv-inbox__settings-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 14px;
}
.mfv-inbox__settings-heading svg {
  color: #9ca3af;
}
.mfv-inbox__settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mfv-inbox__settings-radios {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mfv-inbox__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.4;
}
.mfv-inbox__toggle input[type="checkbox"],
.mfv-inbox__toggle input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--mfv-primary, #0e7490);
  flex-shrink: 0;
}

.mfv-inbox__settings-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
}
.mfv-inbox__btn--save {
  padding: 10px 28px;
  font-size: 0.9rem;
}
.mfv-inbox__save-status {
  font-size: 0.85rem;
  color: #059669;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Menu Badge                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #dc2626;
  color: #fff;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 8px;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Responsive                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .mfv-inbox__sender {
    width: auto;
    max-width: 110px;
  }
  .mfv-inbox__row {
    padding: 12px;
  }
  .mfv-inbox__row-body {
    flex-wrap: wrap;
    gap: 4px;
  }
  .mfv-inbox__time {
    width: 100%;
    margin-top: 2px;
  }
  .mfv-inbox__tabs {
    overflow-x: auto;
  }
  .mfv-inbox__tab {
    padding: 8px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .mfv-inbox__settings-grid {
    grid-template-columns: 1fr;
  }
  .mfv-inbox__detail-actions {
    flex-direction: column;
  }
  .mfv-inbox__detail-contact {
    flex-direction: column;
  }
  .mfv-inbox__reply-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .mfv-inbox__reply-actions .mfv-inbox__btn {
    justify-content: center;
  }
  .mfv-inbox__filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Filter Bar                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.mfv-inbox__filter-select {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #374151;
  background: #fff;
  cursor: pointer;
  min-width: 180px;
  outline: none;
  transition: border-color 0.15s;
}
.mfv-inbox__filter-select:focus {
  border-color: var(--mfv-primary, #0e7490);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Reply Form                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-inbox__reply-form {
  margin-top: 24px;
  padding: 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.mfv-inbox__reply-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px;
}
.mfv-inbox__reply-to-email {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0 0 14px;
}
.mfv-inbox__reply-to-email svg {
  color: #9ca3af;
  flex-shrink: 0;
}
.mfv-inbox__reply-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #374151;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.mfv-inbox__reply-textarea:focus {
  border-color: var(--mfv-primary, #0e7490);
}
.mfv-inbox__reply-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.mfv-inbox__reply-status {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  Messages View — Modern Inbox                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */
.mfv-msg__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
.mfv-msg__summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #6b7280;
}
.mfv-msg__summary-left svg {
  color: #9ca3af;
}
.mfv-msg__unread-badge {
  background: var(--mfv-primary, #0e7490);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
}

.mfv-msg__list {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.mfv-msg__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
}
.mfv-msg__row:last-child {
  border-bottom: none;
}
.mfv-msg__row:hover {
  background: #f9fafb;
}
.mfv-msg__row--unread {
  background: #f0f9ff;
}
.mfv-msg__row--unread:hover {
  background: #e0f2fe;
}

/* Avatar */
.mfv-msg__avatar {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}
.mfv-msg__avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.mfv-msg__avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mfv-primary, #0e7490), #06b6d4);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}
.mfv-msg__online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mfv-primary, #0e7490);
  border: 2px solid #fff;
}

/* Content */
.mfv-msg__content {
  flex: 1;
  min-width: 0;
}
.mfv-msg__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.mfv-msg__name {
  font-size: 0.92rem;
  font-weight: 500;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mfv-msg__name--unread {
  font-weight: 700;
  color: #111827;
}
.mfv-msg__time {
  font-size: 0.76rem;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}
.mfv-msg__time--unread {
  color: var(--mfv-primary, #0e7490);
  font-weight: 600;
}

/* Preview row */
.mfv-msg__preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mfv-msg__preview {
  flex: 1;
  font-size: 0.84rem;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.mfv-msg__preview--unread {
  color: #4b5563;
}
.mfv-msg__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--mfv-primary, #0e7490);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 11px;
}

/* ─── Messages Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .mfv-msg__row {
    padding: 12px 14px;
    gap: 10px;
  }
  .mfv-msg__avatar,
  .mfv-msg__avatar img,
  .mfv-msg__avatar-initial {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .mfv-msg__name {
    font-size: 0.86rem;
  }
  .mfv-msg__preview {
    font-size: 0.8rem;
  }
  .mfv-msg__online-dot {
    width: 10px;
    height: 10px;
  }
}
