/* ==========================================================================
   ShiftRelay — Me Profile Page
   Cover photo · Avatar · Bio · Current Position · Experience · Milestones
   ========================================================================== */

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.me-profile-page {
  padding-bottom: 24px;
}

/* ── Cover hero ──────────────────────────────────────────────────────────── */
.me-cover-hero {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #004D2E 0%, #008751 40%, #00A862 80%, #34d399 100%);
  border-radius: 16px;
  overflow: visible;
  margin-bottom: 60px;
  flex-shrink: 0;
}

.me-cover-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-cover-edit-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.me-cover-edit-btn:hover { background: rgba(0,0,0,0.65); }
.me-cover-edit-btn svg { width: 13px; height: 13px; stroke: #fff; }

/* ── Avatar — floats half out of cover ──────────────────────────────────── */
.me-avatar-wrap {
  position: absolute;
  bottom: -44px;
  left: 20px;
  z-index: 10;
}

.me-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(135deg, #008751, #00A862);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  position: relative;
}
.me-avatar.has-photo {
  background: #052216;
}
.me-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.me-avatar-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s;
}
.me-avatar:hover .me-avatar-edit-overlay { opacity: 1; }
.me-avatar-edit-overlay svg { width: 22px; height: 22px; stroke: #fff; }

/* ── Identity block ──────────────────────────────────────────────────────── */
.me-identity {
  padding: 10px 20px 0;
}

.me-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.me-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.me-name svg { width: 18px; height: 18px; flex-shrink: 0; }

.me-headline {
  font-size: 14px;
  color: var(--text-secondary, #64748b);
  margin: 4px 0 0;
  line-height: 1.4;
}

.me-name-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
  flex-shrink: 0;
}

.me-name-actions button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* Role pill */
.me-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 8px;
}
.me-role-pill.outgoing  { background: #dbeafe; color: #1d4ed8; }
.me-role-pill.incoming  { background: #d1fae5; color: #005A35; }
.me-role-pill.supervisor{ background: #fed7aa; color: #9a3412; }
.me-role-pill.owner     { background: #ede9fe; color: #5b21b6; }
.me-role-pill.default   { background: #f1f5f9; color: #475569; }

/* Meta chips row */
.me-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 0;
}
.me-meta-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}
.me-meta-chip svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

/* ── Stats strip ─────────────────────────────────────────────────────────── */
.me-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0 4px;
}
.me-stat-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.me-stat-card strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: #008751;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 4px;
}
.me-stat-card span {
  font-size: 10px;
  color: var(--text-secondary, #64748b);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Section card base ───────────────────────────────────────────────────── */
.me-section {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 10px 0;
}
.me-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.me-section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.me-section-action {
  font-size: 12px;
  font-weight: 600;
  color: #008751;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.me-section-action:hover { background: rgba(0, 135, 81,0.08); }
.me-section-action svg { width: 13px; height: 13px; stroke: currentColor; }

/* ── About / Bio ─────────────────────────────────────────────────────────── */
.me-bio-text {
  font-size: 14px;
  color: var(--text-main, #1e293b);
  line-height: 1.65;
  margin: 0;
}
.me-bio-edit-form {
  margin-top: 12px;
}
.me-bio-edit-form textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: var(--bg-surface-subtle, #f8fafc);
  box-sizing: border-box;
}
.me-bio-edit-form .me-save-bio-btn {
  margin-top: 8px;
}

/* ── Current Position ────────────────────────────────────────────────────── */
.me-position-org-name {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.me-position-org-name svg { width: 16px; height: 16px; stroke: #008751; }
.me-position-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.me-position-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}
.me-position-row svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex-shrink: 0; }
.me-position-row strong { color: var(--text-main, #1e293b); font-weight: 600; }

.me-clock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}
.me-clock-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}
.me-clock-status-pill.active  { background: #d1fae5; color: #005A35; }
.me-clock-status-pill.active::before  { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #00A862; display: inline-block; }
.me-clock-status-pill.inactive{ background: #f1f5f9; color: #64748b; }
.me-clock-status-pill.inactive::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; display: inline-block; }

/* ── Work Experience Timeline ────────────────────────────────────────────── */
.me-timeline {
  display: flex;
  flex-direction: column;
}
.me-timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.me-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle, #e2e8f0);
}
.me-timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #008751;
  flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #008751;
}
.me-timeline-dot.current { background: #00A862; box-shadow: 0 0 0 2px #00A862; }
.me-timeline-body { flex: 1; min-width: 0; }
.me-timeline-title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 2px;
  color: var(--text-main, #1e293b);
}
.me-timeline-meta {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin: 0 0 5px;
}
.me-timeline-desc {
  font-size: 13px;
  color: var(--text-main, #1e293b);
  line-height: 1.55;
  margin: 0;
}
.me-experience-empty {
  text-align: center;
  padding: 24px 0 8px;
  color: var(--text-secondary, #64748b);
  font-size: 13px;
}
.me-experience-empty svg {
  width: 40px;
  height: 40px;
  stroke: var(--border-subtle, #e2e8f0);
  display: block;
  margin: 0 auto 10px;
}

/* ── Inline add forms ────────────────────────────────────────────────────── */
.me-add-form {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-surface-subtle, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.me-add-form input,
.me-add-form textarea,
.me-add-form select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}
.me-add-form input:focus,
.me-add-form textarea:focus { outline: 2px solid #008751; border-color: transparent; }
.me-add-form textarea { min-height: 72px; resize: vertical; }
.me-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.me-form-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 4px; display: block; }
.me-present-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.me-form-actions { display: flex; gap: 8px; }
.me-form-actions button { flex: 1; min-height: 38px; font-size: 13px; }

.me-add-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #008751;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  margin-top: 4px;
}
.me-add-trigger:hover { opacity: 0.75; }
.me-add-trigger svg { width: 16px; height: 16px; stroke: currentColor; }

/* ── Skills & Certs ──────────────────────────────────────────────────────── */
.me-skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.me-skill-add-wrap {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.me-skill-add-wrap input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.me-skill-add-wrap button { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* ── Certificate Cards & Professional Credentials ───────────────────────── */
.me-certs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.me-cert-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface-subtle, #f8fafc);
  position: relative;
  transition: all 0.15s ease;
}

.me-cert-card:hover {
  border-color: #008751;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 135, 81, 0.06);
}

.me-cert-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #008751 0%, #00A862 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.me-cert-icon-badge svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

.me-cert-body {
  flex: 1;
  min-width: 0;
}

.me-cert-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  margin: 0 0 2px;
}

.me-cert-issuer {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin: 0 0 6px;
}

.me-cert-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #64748b;
}

.me-cert-verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #d1fae5;
  color: #005A35;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.me-cert-verified-pill svg {
  width: 11px;
  height: 11px;
  stroke: #005A35;
}

/* ── Current Job Form & Active Posting ───────────────────────────────────── */
.me-active-job-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #005A35;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.me-active-job-badge svg {
  width: 14px;
  height: 14px;
  stroke: #00A862;
}

/* ── Milestone badges ────────────────────────────────────────────────────── */
.me-badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.me-badge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface, #fff);
  transition: all 0.15s;
  opacity: 0.55;
}
.me-badge-card.earned {
  border-color: #00A862;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  opacity: 1;
}
.me-badge-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.me-badge-card.earned .me-badge-icon-wrap {
  background: linear-gradient(135deg, #008751 0%, #00A862 100%);
}
.me-badge-icon-wrap svg { width: 20px; height: 20px; stroke: #94a3b8; fill: none; }
.me-badge-card.earned .me-badge-icon-wrap svg { stroke: #fff; }
.me-badge-info { min-width: 0; }
.me-badge-name {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--text-main, #1e293b);
}
.me-badge-progress {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  margin: 0;
}
.me-badge-card.earned .me-badge-progress { color: #008751; font-weight: 600; }

/* ── Gallery ─────────────────────────────────────────────────────────────── */
.me-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.me-gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

/* ── Official credential CTA ─────────────────────────────────────────────── */
.me-credential-cta {
  margin: 16px 0 8px;
}
.me-credential-cta button {
  width: 100%;
  min-height: 52px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #008751 0%, #00A862 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.15s;
}
.me-credential-cta button:hover { opacity: 0.9; }
.me-credential-cta button svg { width: 18px; height: 18px; stroke: #fff; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .me-cover-hero { height: 140px; margin-bottom: 52px; }
  .me-avatar { width: 80px; height: 80px; font-size: 26px; }
  .me-avatar-wrap { bottom: -38px; }
  .me-name { font-size: 19px; }
  .me-stats-strip { grid-template-columns: repeat(2, 1fr); }
  .me-badges-grid { grid-template-columns: 1fr; }
  .me-form-row-2 { grid-template-columns: 1fr; }
  .me-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .me-cover-hero { height: 210px; margin-bottom: 68px; }
  .me-avatar { width: 108px; height: 108px; }
  .me-avatar-wrap { bottom: -50px; }
  .me-name { font-size: 24px; }
  .me-stats-strip { gap: 14px; }
}

@media (min-width: 1024px) {
  .me-cover-hero { height: 220px; margin-bottom: 72px; }
  .me-avatar { width: 112px; height: 112px; font-size: 38px; }
  .me-avatar-wrap { bottom: -52px; }
  .me-name { font-size: 26px; }
}

/* ── Me Profile Sub-tabs, Relays List & Schedule ────────────────────────── */
.me-relays-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.me-relay-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.15s ease;
}

.me-relay-card:hover {
  border-color: #008751;
  box-shadow: 0 4px 12px rgba(0, 135, 81, 0.06);
}

.me-relay-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.me-relay-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.me-relay-status.ack {
  background: #ecfdf5;
  color: #005A35;
  border: 1px solid #a7f3d0;
}

.me-relay-status.relayed {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.me-relay-time {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.me-relay-summary {
  font-size: 14px;
  color: var(--text-main, #0f172a);
  margin: 0 0 10px;
  line-height: 1.5;
}

.me-relay-actions-preview {
  background: var(--bg-surface-subtle, #f8fafc);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.me-relay-actions-preview strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #64748b);
  margin-bottom: 6px;
}

.me-relay-actions-preview ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.me-relay-actions-preview li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
}

.me-switch-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:not(:checked) + .me-switch-track {
  background: #cbd5e1 !important;
}

input:checked + .me-switch-track::before {
  transform: translateX(20px);
}

