/* Hard Déco — RC1.5.70 : page dédiée Mon profil. */
.profile-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-push-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.profile-push-status,
.profile-push-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile-push-status { color: var(--muted); font-size: 13px; font-weight: 650; }
.profile-push-status .lucide { width: 18px; height: 18px; }
.profile-push-status[data-state="enabled"] { color: var(--success, #15803d); }
.profile-push-status[data-state="blocked"] { color: var(--danger, #dc2626); }

@media (max-width: 620px) {
  .profile-push-control { align-items: stretch; flex-direction: column; }
  .profile-push-actions :is(.btn, .btn-secondary) { width: 100%; justify-content: center; }
}

.profile-page-actions,
.profile-password-actions,
.profile-logo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-page-actions :is(.btn, .btn-secondary),
.profile-password-actions :is(.btn, .btn-secondary),
.profile-logo-actions :is(.btn, .btn-secondary) {
  white-space: nowrap;
}

.profile-page-content > form > .tab-panel {
  display: none;
  padding: 16px;
}

.profile-page-content > form > .tab-panel.active {
  display: block;
}

.profile-section-grid {
  grid-template-columns: minmax(210px, .42fr) minmax(0, 1fr);
}

.profile-identity-card {
  align-content: start;
  justify-items: center;
  text-align: center;
}

.profile-avatar {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--hd-color-border, var(--border));
  border-radius: 24px;
  background: color-mix(in srgb, var(--accent) 8%, var(--hd-color-surface-muted, var(--bg)));
  color: var(--accent);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.profile-avatar > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.profile-avatar svg {
  width: 34px;
  height: 34px;
}

.profile-identity-copy {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 12px 0;
}

.profile-identity-copy strong,
.profile-identity-copy span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-copy strong {
  color: var(--hd-color-text, var(--text));
  font-size: 1rem;
}

.profile-identity-copy > span:not(.profile-role-badge) {
  color: var(--hd-color-text-muted, var(--muted));
  font-size: .7rem;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--hd-color-border, var(--border)));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  color: var(--accent);
  font-size: .62rem;
  font-weight: 750;
}

.profile-logo-actions {
  flex-wrap: wrap;
  justify-content: center;
}

.profile-danger-action {
  color: var(--danger, #dc2626);
}

.profile-wide-card {
  grid-column: 1 / -1;
}

.profile-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.profile-switch-row {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--hd-color-border, var(--border));
  border-radius: 10px;
  background: var(--hd-color-surface-muted, var(--bg));
  cursor: pointer;
}

.profile-switch-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.profile-switch-row > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-switch-row strong {
  color: var(--hd-color-text, var(--text));
  font-size: .72rem;
}

.profile-switch-row small {
  color: var(--hd-color-text-muted, var(--muted));
  font-size: .63rem;
  line-height: 1.35;
}

.profile-code-field {
  max-width: 280px;
}

.profile-number-control {
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(90px, 160px) auto;
  align-items: center;
  gap: 8px;
}

.profile-number-control > span {
  color: var(--hd-color-text-muted, var(--muted));
  font-size: .72rem;
  font-weight: 700;
}

.profile-commission-grid {
  align-items: end;
}

.profile-password-form {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.profile-password-form[hidden] {
  display: none !important;
}

.profile-password-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.profile-access-summary {
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--hd-color-border, var(--border));
  border-radius: 10px;
  background: var(--hd-color-surface-muted, var(--bg));
}

.profile-access-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
}

.profile-access-icon svg {
  width: 19px;
  height: 19px;
}

.profile-access-summary > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-access-summary small,
.profile-access-summary > span:last-child {
  color: var(--hd-color-text-muted, var(--muted));
  font-size: .64rem;
}

.profile-access-summary strong {
  color: var(--hd-color-text, var(--text));
  font-size: .78rem;
}

.profile-savebar {
  grid-column: 2;
}

.profile-savebar .btn[disabled],
.profile-page-actions button[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.profile-savebar .settings-save-status[data-state="dirty"] svg {
  color: #d97706;
}

.profile-savebar .settings-save-status[data-state="error"] svg {
  color: #dc2626;
}

.profile-savebar .settings-save-status[data-state="saving"] svg {
  color: var(--accent);
}

.profile-spin {
  animation: profile-spin .8s linear infinite;
}

@keyframes profile-spin {
  to { transform: rotate(360deg); }
}

.profile-page.is-dirty .profile-savebar {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--hd-color-border, var(--border)));
}

@media (max-width: 900px) {
  .profile-section-grid,
  .profile-toggle-grid {
    grid-template-columns: 1fr;
  }

  .profile-identity-card,
  .profile-wide-card {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .profile-page-header {
    align-items: flex-start;
  }

  .profile-page-header > div:first-child > p:last-child {
    display: none;
  }

  .profile-page-actions .btn-secondary span {
    display: none;
  }

  .profile-page-actions .btn-secondary {
    width: 42px;
    padding-inline: 0;
  }

  .profile-page-shell {
    grid-template-columns: 1fr;
  }

  .profile-page-shell > .settings-page-tabs {
    position: static;
    grid-template-columns: repeat(5, minmax(70px, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
  }

  .profile-page-shell > .settings-page-tabs::-webkit-scrollbar {
    display: none;
  }

  .profile-page-shell > .settings-page-tabs .tab {
    min-width: 82px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-page-shell > .settings-page-tabs .tab small {
    display: none;
  }

  .profile-page-shell > .settings-page-tabs .tab strong {
    font-size: .68rem;
  }

  .profile-savebar {
    grid-column: 1;
  }

  .profile-savebar .btn {
    width: 100%;
    justify-content: center;
  }

  .profile-savebar .settings-save-status {
    display: none;
  }

  .profile-password-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .profile-password-actions :is(.btn, .btn-secondary) {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .profile-page-content > form > .tab-panel {
    padding: 12px;
  }

  .profile-page-content .settings-section-heading {
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .profile-page-content .grid-2,
  .profile-page-content .grid-3 {
    grid-template-columns: 1fr;
  }

  .profile-access-summary {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .profile-access-summary > span:last-child {
    grid-column: 1 / -1;
  }
}
