/* Unified professional shell for coach & trainee routes (see Layout: .role-app) */

.app-shell {
  background: transparent;
}

.role-app {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 50%, #f8fafc 100%);
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  min-height: calc(100vh - 140px);
}

/* Full-screen chat thread: no bottom nav — avoid extra bottom padding */
.role-app--embedded {
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  min-height: auto;
}

/* Cards: consistent depth */
.role-app .card {
  border: 1px solid #eef2f7;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.role-app .section-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.role-app .form-group label {
  font-weight: 600;
  color: #111827;
}

.role-app .form-group input:not([type='file']):not([type='checkbox']),
.role-app .form-group textarea,
.role-app .form-group select,
.role-app .card > select {
  border-radius: 10px;
  border: 1px solid #dbe3ee;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.role-app .form-group input:focus,
.role-app .form-group textarea:focus,
.role-app .form-group select:focus,
.role-app .card > select:focus {
  outline: none;
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.18);
}

.role-app .btn-primary {
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(233, 30, 99, 0.22);
}

.role-app .page-link {
  border-radius: 10px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.role-app .page-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

/* Coach dashboard (classes from App.css) */
.role-app .coach-hero {
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.role-app .coach-kpi-card {
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.role-app .coach-trainee-item {
  background: #fafbfc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  border-radius: 12px;
  padding: 10px 12px;
}

.role-app .coach-trainee-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #f8fafc, #eef2f7);
  border: 2px solid #fff;
  box-shadow: 0 8px 20px rgba(233, 30, 99, 0.16);
}

/* Prevent global .avatar-img rules from stretching dashboard avatars */
.role-app .coach-trainee-avatar .avatar-img {
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit;
  object-fit: cover;
  display: block;
  border: 0 !important;
}

.role-app .coach-trainee-avatar i {
  font-size: 22px;
}

/* Chat list */
.role-app .chat-list {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #eef2f7;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  background: #fff;
}

.role-app .chat-item:last-child {
  border-bottom: none;
}

/* Trainee media (App.css) */
.role-app .trainee-media-hero {
  background: linear-gradient(135deg, #fff 0%, #fff1f6 100%);
  border: 1px solid #fce7f3;
}

.role-app .trainee-media-empty {
  text-align: center;
}

/* Sessions */
.role-app .sessions-section .session-card {
  border: 1px solid #eef2f7;
}

.trainee-sessions-shell {
  padding-bottom: 8px;
}

/* Bottom navigation */
.app-shell .bottom-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #eef2f7;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.08);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.app-shell .nav-item-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-shell .nav-unread-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e91e63, #be185d);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(233, 30, 99, 0.5);
  pointer-events: none;
  box-sizing: border-box;
}

[dir='rtl'] .app-shell .nav-unread-badge {
  right: auto;
  left: -9px;
}

/* Profile avatars (coach / trainee profile) */
.profile-photo-preview {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 8px;
  border: 3px solid #fff;
  box-shadow: 0 10px 24px rgba(233, 30, 99, 0.2);
}

.profile-photo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(145deg, #f8fafc, #eef2f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 28px;
}

.coach-media-line {
  padding: 12px 4px;
  border-bottom: 1px solid #f1f5f9;
  margin: 0;
  color: #374151;
}

.coach-media-line:last-child {
  border-bottom: none;
}

.coach-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.coach-session-row:last-child {
  border-bottom: none;
}

/* Coach tools pages: plans, media, sessions */
.coach-page-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.coach-page-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff 0%, #fff5f9 45%, #f8fafc 100%);
  border: 1px solid #fce7f3;
  box-shadow: 0 10px 28px rgba(233, 30, 99, 0.1);
}

.coach-page-hero-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fce7f3, #fbcfe8);
  color: #be185d;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(219, 39, 119, 0.2);
}

.coach-page-hero-text h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.coach-page-hero-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.coach-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.coach-section-header-row .section-header {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.coach-section-header-row .section-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.coach-section-header-row .section-header i {
  color: #db2777;
  font-size: 1.1rem;
}

.coach-section-meta {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.coach-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.coach-tier-cell {
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid #eef2f7;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.coach-tier-cell .form-group {
  margin-bottom: 0;
}

.coach-tier-cell .form-group label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.coach-tier-cell .coach-plan-one-time {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #6c757d;
  margin: 2px 0 10px;
  text-transform: none;
  letter-spacing: normal;
}

.coach-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.coach-plan-trainee-bar {
  margin-bottom: 18px;
}

.coach-plan-trainee-bar select {
  width: 100%;
  max-width: 420px;
}

.coach-plan-bilingual-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 768px) {
  .coach-plan-bilingual-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.coach-plan-lang-column {
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.coach-lang-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #be185d;
  background: #fce7f3;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.coach-form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.coach-form-section-title:first-child {
  margin-top: 0;
}

.coach-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.coach-toggle-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #db2777;
  flex-shrink: 0;
}

.coach-toggle-row label {
  margin: 0;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
  cursor: pointer;
}

.coach-nutrition-panel {
  margin: 12px 0 20px;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed #f9a8d4;
  background: linear-gradient(180deg, #fff 0%, #fdf2f8 100%);
}

.coach-file-drop {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: #fafbfc;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.coach-file-drop:hover {
  border-color: #f472b6;
  background: #fff;
}

.coach-file-drop input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.coach-file-drop-label {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.coach-file-drop-label i {
  font-size: 28px;
  color: #db2777;
  opacity: 0.85;
}

.coach-file-name {
  margin-top: 10px;
  font-size: 13px;
  color: #0f172a;
  word-break: break-all;
}

.coach-media-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coach-media-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fafbfc;
  border: 1px solid #eef2f7;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.coach-media-item:hover {
  border-color: #e9d5ff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}

.coach-media-item-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fce7f3, #e9d5ff);
  color: #9d174d;
  font-size: 18px;
}

.coach-media-item-body {
  flex: 1;
  min-width: 0;
}

.coach-media-item-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.coach-media-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.coach-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.coach-pill--type-training {
  background: #dbeafe;
  color: #1d4ed8;
}

.coach-pill--type-nutrition {
  background: #dcfce7;
  color: #15803d;
}

.coach-pill--format {
  background: #f1f5f9;
  color: #475569;
}

.coach-pill--scope-public {
  background: #fef3c7;
  color: #b45309;
}

.coach-pill--scope-trainee {
  background: #ede9fe;
  color: #5b21b6;
}

.coach-empty-state {
  text-align: center;
  padding: 28px 16px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.coach-empty-state i {
  display: block;
  font-size: 36px;
  margin-bottom: 12px;
  color: #cbd5e1;
}

.coach-session-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eef2f7;
  border-inline-start: 4px solid #f472b6;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  margin-bottom: 10px;
}

.coach-session-card:last-child {
  margin-bottom: 0;
}

.coach-session-card-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fbcfe8, #ddd6fe);
  color: #6b21a8;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coach-session-card-body {
  flex: 1;
  min-width: 0;
}

.coach-session-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.coach-session-card-meta {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.coach-session-card-meta i {
  color: #db2777;
  font-size: 12px;
}

.coach-session-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #be185d;
  text-decoration: none;
  word-break: break-all;
}

.coach-session-link:hover {
  text-decoration: underline;
}

/* Coach dashboard */
.coach-dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.coach-kpi-grid--dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

@media (min-width: 520px) {
  .coach-kpi-grid--dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.coach-kpi-card--rich {
  position: relative;
  overflow: hidden;
  padding: 14px 14px 16px;
}

.coach-kpi-card--rich::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #f472b6, #c026d3);
  opacity: 0.85;
}

.coach-kpi-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.coach-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fce7f3, #fae8ff);
  color: #be185d;
  font-size: 14px;
  flex-shrink: 0;
}

.coach-kpi-card--rich .coach-kpi-label {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.coach-kpi-card--rich .coach-kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0f172a, #4b5563);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.coach-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 400px) {
  .coach-quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.coach-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
  border: 1px solid #eef2f7;
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.coach-quick-action:hover {
  transform: translateY(-2px);
  border-color: #fbcfe8;
  box-shadow: 0 10px 24px rgba(233, 30, 99, 0.14);
}

.coach-quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fce7f3, #e9d5ff);
  color: #9d174d;
  font-size: 18px;
}

.coach-trainee-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-trainee-title-row h3 {
  margin: 0;
}

.coach-trainee-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.coach-trainee-pill--paid {
  background: #dcfce7;
  color: #166534;
}

.coach-trainee-pill--lead {
  background: #ffedd5;
  color: #c2410c;
}

/* Coach dashboard — trainee progress (workout completion from trainee progressMeta) */
.role-app .coach-trainee-item--rich {
  padding: 14px 16px;
}

.coach-trainee-rich-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .coach-trainee-rich-top {
    grid-template-columns: auto 1fr;
  }

  .coach-trainee-rich-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

.coach-trainee-avatar--lg {
  position: relative;
  width: 56px;
  height: 56px;
}

.coach-trainee-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

[dir='rtl'] .coach-trainee-online-dot {
  right: auto;
  left: 2px;
}

.coach-trainee-rich-main {
  min-width: 0;
}

.coach-trainee-email {
  margin: 2px 0 4px;
  font-size: 13px;
  color: #64748b;
}

.coach-trainee-goal-line {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.coach-trainee-activity-meta {
  font-size: 12px;
  color: #16a34a;
  font-weight: 500;
  line-height: 1.35;
}

.coach-trainee-activity-meta-sep {
  margin: 0 6px;
  color: #cbd5e1;
}

.coach-trainee-rich-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.coach-trainee-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.coach-trainee-icon-btn:hover {
  color: #db2777;
  border-color: #f9a8d4;
  background: #fff1f6;
}

.coach-trainee-progress-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
}

.coach-trainee-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e9ecef;
  overflow: hidden;
  min-width: 0;
}

.coach-trainee-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ec4899, #db2777);
  transition: width 0.35s ease;
}

.coach-trainee-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.coach-trainee-lead-note {
  margin-top: 8px;
  margin-bottom: 0;
}

/* Client details modal */
.coach-client-modal-overlay.modal {
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

@media (min-width: 560px) {
  .coach-client-modal-overlay.modal {
    align-items: center;
  }
}

.coach-client-modal.modal-content {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  border: none;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.coach-client-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fff;
}

.coach-client-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.coach-client-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.coach-client-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.coach-client-modal-body {
  margin: 0;
  padding: 0 20px 8px;
  background: #fff;
}

.coach-client-modal-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: start;
}

.coach-client-modal-row:last-of-type {
  border-bottom: none;
}

.coach-client-modal-row dt {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

.coach-client-modal-row dd {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
  text-align: end;
}

[dir='rtl'] .coach-client-modal-row dd {
  text-align: start;
}

.coach-client-modal-hint {
  font-weight: 500;
  color: #64748b;
}

.coach-client-modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  background: #fff;
}

.coach-client-modal-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.coach-client-modal-btn--primary {
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fff;
  border-color: transparent;
}

.coach-client-modal-btn--primary:hover {
  box-shadow: 0 8px 20px rgba(219, 39, 119, 0.35);
}

.coach-client-modal-btn--secondary {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.coach-client-modal-btn--secondary:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

/* === REAL trainee KPI grid inside the coach client-detail modal === */
.coach-client-modal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 20px 4px;
  background: #fff;
}

@media (min-width: 480px) {
  .coach-client-modal-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.coach-client-modal-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fdf2f8, #fff7ed);
  border: 1px solid #fce7f3;
  border-radius: 12px;
  min-width: 0;
}

.coach-client-modal-kpi > i {
  font-size: 14px;
  color: #db2777;
}

.coach-client-modal-kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.coach-client-modal-kpi-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.3;
}

/* === Achievements section in the same modal === */
.coach-client-modal-achievements {
  padding: 12px 20px 16px;
  background: #fff;
}

.coach-client-modal-achievements-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #1f2937;
  font-weight: 600;
}

.coach-client-modal-achievements-head i {
  color: #f59e0b;
  margin-inline-end: 6px;
}

.coach-client-modal-achievements-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 999px;
}

.coach-client-modal-achievements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coach-client-modal-achievement {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #78350f;
}

.coach-client-modal-achievement-icon i {
  font-size: 12px;
  color: #b45309;
}

.coach-client-modal-achievements-empty {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
}

/* === Dashboard trainee card: real micro-stats (this month) === */
.coach-trainee-microstats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 0 4px;
  margin-top: 6px;
  border-top: 1px dashed #f1f5f9;
}

.coach-trainee-microstat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.coach-trainee-microstat i {
  font-size: 11px;
  color: #ec4899;
}

.coach-trainee-microstat--accent {
  color: #b45309;
}

.coach-trainee-microstat--accent i {
  color: #f59e0b;
}

.coach-dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 14px;
}

.coach-dashboard-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.coach-dashboard-section-head h2 i {
  color: #db2777;
}

.coach-kpi-card--clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.coach-kpi-card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(233, 30, 99, 0.14);
}

.coach-kpi-card--clickable:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.45);
}

.coach-kpi-card--clickable:focus:not(:focus-visible) {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.coach-kpi-card--clickable:focus-visible {
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.45);
}

.coach-reviews-modal .modal-content {
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: min(85vh, 560px);
  display: flex;
  flex-direction: column;
}

.coach-reviews-modal-body {
  padding: 0 18px 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.coach-reviews-modal-empty {
  margin: 0;
  padding: 12px 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.coach-reviews-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: min(50vh, 360px);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.coach-review-detail-row {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

.coach-review-detail-row:last-child {
  border-bottom: none;
}

.coach-review-detail-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

@media (min-width: 380px) {
  .coach-review-detail-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
}

.coach-review-detail-name {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
}

.coach-star-row {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.coach-star {
  font-size: 14px;
}

.coach-star--on {
  color: #f59e0b;
}

.coach-star--off {
  color: #e2e8f0;
}

.coach-review-detail-comment {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

.coach-review-detail-comment-label {
  font-weight: 600;
  color: #64748b;
}

/* Coach chat list (page) */
.coach-chat-list-card {
  padding: 0;
  overflow: hidden;
}

.coach-chat-list-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.role-app .coach-chat-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin: 0;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
  background: #fff;
  transition: background 0.15s ease;
}

.role-app .coach-chat-list-item:last-child {
  border-bottom: none;
}

/* conversation.css makes .chat-header fixed for thread view; reset inside list rows even without .chat-list */
.role-app .coach-chat-list-item .chat-header {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  width: auto;
  z-index: auto;
  padding: 0;
  border-bottom: none;
  background: transparent;
  box-shadow: none;
  margin-bottom: 4px;
}

.role-app .coach-chat-list-item:hover {
  background: #fdf2f8;
}

.role-app .coach-chat-list-item .chat-avatar {
  margin: 0;
}

.role-app .coach-chat-list-item .avatar-img {
  width: 52px;
  height: 52px;
  border: 2px solid #fff;
  box-shadow: 0 6px 16px rgba(233, 30, 99, 0.15);
}

.coach-chat-row-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coach-chat-row-chevron {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
}

.role-app .coach-chat-list-item:hover .coach-chat-row-chevron {
  background: #fce7f3;
  color: #be185d;
}

/* Conversation thread (embedded layout) */
.role-app--embedded .conversation-shell {
  max-width: 400px;
  margin: 0 auto;
}

.role-app--embedded .conversation-shell .chat-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: #fce7f3;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.role-app--embedded .conversation-shell .user-avatar {
  border-color: #fbcfe8;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.15);
}

.role-app--embedded .conversation-shell .chat-messages {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 55%, #eef2f7 100%);
}

.role-app--embedded .conversation-shell .message-input-container {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top-color: #e2e8f0;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.08);
}

.role-app--embedded .conversation-shell .message-input {
  border-radius: 14px;
  border-color: #e2e8f0;
  background: #fff;
}

.role-app--embedded .conversation-shell .message-input:focus-within {
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.2);
}

.role-app--embedded .conversation-shell .send-btn {
  box-shadow: 0 4px 14px rgba(233, 30, 99, 0.35);
}

@media (prefers-color-scheme: dark) {
  .role-app {
    background: linear-gradient(180deg, #0f172a 0%, #111827 50%, #0f172a 100%);
  }

  .role-app .card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  }

  .role-app .form-group label {
    color: #f1f5f9;
  }

  .role-app .form-group input:not([type='file']):not([type='checkbox']),
  .role-app .form-group textarea,
  .role-app .form-group select,
  .role-app .card > select {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
  }

  .app-shell .bottom-nav {
    background: rgba(15, 23, 42, 0.92);
    border-top-color: #334155;
  }

  .role-app .coach-page-hero {
    background: linear-gradient(135deg, #1e293b 0%, #1a1625 100%);
    border-color: #4c1d95;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  }

  .role-app .coach-page-hero-text h2 {
    color: #f8fafc;
  }

  .role-app .coach-page-hero-text p {
    color: #94a3b8;
  }

  .role-app .coach-tier-cell,
  .role-app .coach-plan-lang-column,
  .role-app .coach-toggle-row {
    background: #0f172a;
    border-color: #334155;
  }

  .role-app .coach-toggle-row label {
    color: #f1f5f9;
  }

  .role-app .coach-nutrition-panel {
    background: linear-gradient(180deg, #1e293b 0%, #1a1030 100%);
    border-color: #6b21a8;
  }

  .role-app .coach-file-drop {
    background: #0f172a;
    border-color: #475569;
  }

  .role-app .coach-file-drop-label {
    color: #94a3b8;
  }

  .role-app .coach-file-name {
    color: #e2e8f0;
  }

  .role-app .coach-media-item {
    background: #0f172a;
    border-color: #334155;
  }

  .role-app .coach-media-item-title,
  .role-app .coach-session-card-title {
    color: #f8fafc;
  }

  .role-app .coach-session-card {
    background: #0f172a;
    border-color: #334155;
  }

  .role-app .coach-section-meta {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
  }

  .role-app .coach-form-section-title {
    color: #e2e8f0;
    border-bottom-color: #334155;
  }

  .role-app .coach-form-actions {
    border-top-color: #334155;
  }

  .role-app .coach-kpi-card--rich .coach-kpi-value {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .role-app .coach-quick-action {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    color: #f1f5f9;
  }

  .role-app .coach-quick-action:hover {
    border-color: #6b21a8;
  }

  .role-app .coach-chat-list-item {
    background: #1e293b;
    border-bottom-color: #334155;
  }

  .role-app .coach-chat-list-item:hover {
    background: #312e81;
  }

  .role-app .coach-chat-row-sub {
    color: #94a3b8;
  }

  .role-app .coach-chat-row-chevron {
    background: #334155;
    color: #cbd5e1;
  }

  .role-app .coach-dashboard-section-head {
    border-bottom-color: #334155;
  }

  .role-app .coach-review-detail-name {
    color: #f8fafc;
  }

  .role-app .coach-review-detail-row {
    border-bottom-color: #334155;
  }

  .role-app .coach-star--off {
    color: #475569;
  }

  .role-app .coach-review-detail-comment {
    color: #cbd5e1;
  }

  .role-app .coach-review-detail-comment-label {
    color: #94a3b8;
  }

  .role-app .coach-reviews-modal-empty {
    color: #94a3b8;
  }

  .role-app--embedded .conversation-shell .chat-header {
    background: rgba(30, 41, 59, 0.94);
    border-bottom-color: #4c1d95;
  }

  .role-app--embedded .conversation-shell .user-name {
    color: #f8fafc;
  }

  .role-app--embedded .conversation-shell .back-btn {
    color: #cbd5e1;
  }

  .role-app--embedded .conversation-shell .back-btn:hover {
    background: #334155;
    color: #f8fafc;
  }

  .role-app--embedded .conversation-shell .chat-messages {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  }

  .role-app--embedded .conversation-shell .message-input-container {
    background: rgba(15, 23, 42, 0.96);
    border-top-color: #334155;
  }

  .role-app--embedded .conversation-shell .message-input {
    background: #1e293b;
    border-color: #334155;
  }

  .role-app--embedded .conversation-shell .message-input input {
    color: #f8fafc;
  }
}

.coach-structure-help {
  font-size: 13px;
  color: #6c757d;
  margin: 0 0 12px;
  line-height: 1.5;
}

.coach-structure-json {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 12px;
}

/* Coach profile: top row inside unified card (avoid reusing .profile-header, which targets the page bar in profile.css) */
.unified-profile-card .coach-unified-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.profile-header .logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coach-subsection-title {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 10px;
}

/* Coach earnings */
.coach-earnings-hero-icon {
  background: linear-gradient(145deg, #fce7f3, #e9d5ff) !important;
  color: #9d174d !important;
}

.coach-earnings-summary-card .coach-dashboard-section-head {
  margin-bottom: 12px;
}

.coach-earnings-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.coach-earnings-kpi .coach-kpi-value {
  font-size: 1.65rem;
}

.coach-earnings-empty {
  margin: 8px 0 16px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.coach-earnings-by-currency {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.coach-earnings-currency-block {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border: 1px solid #eef2f7;
}

.coach-earnings-currency-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
}

/* 160px lower bound lets two metrics sit side-by-side starting at ~360px-wide
   phones (after the card's inner padding), instead of waiting for ~440px with
   the previous 200px lower bound. Falls back to one column on iPhone SE. */
.coach-earnings-currency-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

@media (max-width: 360px) {
  .coach-earnings-currency-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.coach-earnings-metric-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

.coach-earnings-metric-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.coach-earnings-metric-value--accent {
  color: #be185d;
}

.coach-earnings-metric-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.coach-earnings-pipeline {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.coach-earnings-pipeline h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
}

.coach-earnings-pipeline p {
  margin: 0;
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}

.coach-earnings-disclaimer {
  margin: 18px 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.coach-earnings-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  border-radius: 12px;
  border: 1px solid #eef2f7;
}

.coach-earnings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

/* === Mobile: convert the earnings table into a stack of cards (≤ 600px) ===
   Hides the <thead>, turns each <tr> into a card, and each <td> into a row
   that displays its own label (from data-label) on the start side and the
   value on the end side. Works for both LTR and RTL. */
@media (max-width: 600px) {
  .coach-earnings-table-wrap {
    overflow-x: visible;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .coach-earnings-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    display: block;
  }

  .coach-earnings-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .coach-earnings-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .coach-earnings-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  }

  .coach-earnings-table tbody tr:hover {
    background: linear-gradient(180deg, #ffffff 0%, #fffafb 100%);
  }

  .coach-earnings-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    text-align: end;
  }

  .coach-earnings-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .coach-earnings-table tbody td:first-child {
    padding-top: 0;
  }

  /* Label badge derived from the data-label attribute (set in JSX) */
  .coach-earnings-table tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    text-align: start;
  }

  /* Client cell: stack name + email on the end side, label on start side */
  .coach-earnings-table tbody td .coach-earnings-client-cell {
    align-items: flex-end;
    text-align: end;
    min-width: 0;
    flex: 1;
  }

  /* Amount cell: keep the accent color and prevent wrapping */
  .coach-earnings-table tbody td.coach-earnings-amount-cell {
    font-weight: 700;
    font-size: 15px;
    color: #be185d;
  }
}

.coach-earnings-table th,
.coach-earnings-table td {
  padding: 12px 14px;
  text-align: start;
  border-bottom: 1px solid #f1f5f9;
}

.coach-earnings-table th {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: #fafbfc;
}

.coach-earnings-table tbody tr:hover {
  background: #fffafb;
}

.coach-earnings-client-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coach-earnings-client-name {
  font-weight: 700;
  color: #0f172a;
}

.coach-earnings-client-email {
  font-size: 12px;
  color: #64748b;
}

.coach-earnings-amount-cell {
  font-weight: 700;
  color: #be185d;
  white-space: nowrap;
}

.coach-earnings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.coach-earnings-dashboard-card .coach-dashboard-section-head {
  align-items: center;
}

.coach-earnings-dashboard-link {
  font-size: 13px;
  font-weight: 700;
}

.coach-earnings-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.coach-earnings-dashboard-metric {
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid #eef2f7;
}

.coach-earnings-dashboard-metric--wide {
  grid-column: 1 / -1;
}

.coach-earnings-dashboard-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.coach-earnings-dashboard-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.coach-earnings-dashboard-value--accent {
  color: #be185d;
}

.coach-earnings-dashboard-cur {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

.coach-earnings-dashboard-foot {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
}
