#tab-profil {
  --profile-surface: #fff;
  --profile-soft: #f3f5f9;
  --profile-border: #dce2eb;
  --profile-text: #172033;
  --profile-muted: #526078;
  --profile-accent: #1d4ed8;
  --profile-danger: #a7192c;
  --profile-danger-bg: #fff5f5;
  max-width: 1160px;
  margin: 0 auto;
  color: var(--profile-text);
}
body.dark-theme #tab-profil {
  --profile-surface: #1a2435;
  --profile-soft: #222f43;
  --profile-border: #3b4b62;
  --profile-text: #f3f6fc;
  --profile-muted: #bac6d8;
  --profile-accent: #a9c5ff;
  --profile-danger: #ffb9c0;
  --profile-danger-bg: #39232b;
}
#ownerProfileContent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "identity identity" "stats stats" "settings password" "settings account" "settings danger";
  align-items: start;
  gap: 18px;
}
#ownerProfileContent[hidden] { display: none; }
#ownerProfileStatus { color: var(--profile-text); }
#ownerProfileStatus:empty { display: none; }
#tab-profil .owner-profile-card {
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: clamp(20px, 2.5vw, 28px);
  overflow: hidden;
  background: var(--profile-surface);
  border: 1px solid var(--profile-border);
  border-radius: 16px;
  color: var(--profile-text);
  box-shadow: 0 6px 24px rgba(15, 23, 42, .06);
}
#tab-profil .owner-profile-card h3 {
  margin: 0 0 18px;
  border: 0;
  padding: 0;
  color: var(--profile-text);
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
#tab-profil .owner-profile-main { grid-area: identity; padding-top: 0; }
.owner-profile-metrics { grid-area: stats; }
.owner-profile-settings { grid-area: settings; }
.owner-profile-password { grid-area: password; }
.owner-profile-account { grid-area: account; }
.owner-profile-danger { grid-area: danger; }
.owner-profile-banner {
  height: 100px;
  margin: 0 calc(-1 * clamp(20px, 2.5vw, 28px));
  background: linear-gradient(115deg, #dce9ff, #ece8ff 55%, #e1f3f3);
}
body.dark-theme .owner-profile-banner { background: linear-gradient(115deg, #263d65, #383456 55%, #254849); }
.owner-profile-identity { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin: -38px 0 24px; position: relative; }
.owner-profile-avatar-wrap { flex: 0 0 96px; position: relative; }
.owner-profile-avatar {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid var(--profile-surface);
  border-radius: 50%;
  background: #3158ad;
  color: #fff;
  font-size: 27px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
}
.owner-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.owner-profile-upload {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--profile-surface);
  border-radius: 50%;
  background: #234da8;
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.owner-profile-upload:hover { background: #173a84; transform: scale(1.05); }
.owner-profile-upload svg { width: 19px; height: 19px; }
.owner-profile-upload input, .owner-profile-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.owner-profile-upload:focus-within { outline: 3px solid var(--profile-accent); outline-offset: 3px; }
.owner-profile-summary { flex: 1 1 220px; min-width: 0; padding-top: 42px; overflow-wrap: anywhere; }
.owner-profile-summary strong { display: block; font-size: 1.35rem; letter-spacing: -.03em; line-height: 1.25; }
.owner-profile-summary > span { display: block; margin-top: 4px; white-space: pre-wrap; }
.owner-profile-summary > span:empty { display: none; }
.owner-profile-summary small { display: block; margin-top: 5px; color: var(--profile-muted); }
.owner-profile-avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 42px; }
.owner-profile-avatar-actions small { flex-basis: 100%; color: var(--profile-muted); }
.owner-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
#tab-profil .owner-profile-card .field { min-width: 0; margin: 0; }
#tab-profil .owner-profile-card .field > span, .owner-profile-choice legend {
  display: block;
  margin-bottom: 7px;
  color: var(--profile-text);
  font-size: .83rem;
  font-weight: 650;
}
#tab-profil .owner-profile-card input:not([type="radio"]):not([type="file"]),
#tab-profil .owner-profile-card textarea, #tab-profil .owner-profile-card select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--profile-border);
  border-radius: 9px;
  background: var(--profile-surface);
  color: var(--profile-text);
}
#tab-profil .owner-profile-card input[readonly] { background: var(--profile-soft); color: var(--profile-muted); }
#tab-profil .owner-profile-card button {
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 9px;
  font: inherit;
  font-size: .85rem;
  font-weight: 650;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}
#tab-profil .owner-profile-card .btn-secondary {
  border: 1px solid var(--profile-border);
  background: var(--profile-surface);
  color: var(--profile-text);
}
#tab-profil .owner-profile-card .btn-secondary:hover { background: var(--profile-soft); }
#tab-profil .owner-profile-card .btn-primary { border: 1px solid #1d4ed8; background: #1d4ed8; color: #fff; }
#tab-profil .owner-profile-card .btn-primary:hover { background: #1e40af; }
#tab-profil .owner-profile-card button:disabled { opacity: .6; cursor: wait; }
.owner-profile-choice { grid-column: 1 / -1; min-width: 0; padding: 0 0 16px; margin: 0; border: 0; border-bottom: 1px solid var(--profile-border); }
.owner-profile-choice legend { padding: 0; }
.owner-profile-segments { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--profile-border); border-radius: 10px; background: var(--profile-soft); }
.owner-profile-segments label { flex: 1 1 auto; min-width: 0; position: relative; cursor: pointer; }
.owner-profile-segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.owner-profile-segments span {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--profile-muted);
  text-align: center;
  overflow-wrap: anywhere;
  font-size: .82rem;
  font-weight: 650;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.owner-profile-segments input:checked + span { background: var(--profile-surface); color: var(--profile-text); box-shadow: 0 1px 5px rgba(15, 23, 42, .16); }
.owner-profile-segments input:focus-visible + span { outline: 3px solid var(--profile-accent); outline-offset: -3px; }
.owner-profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.owner-profile-stats div { min-width: 0; padding: 16px; border: 1px solid var(--profile-border); border-radius: 12px; background: var(--profile-soft); }
.owner-profile-stats svg, .owner-profile-stats i { display: block; width: 20px; height: 20px; margin-bottom: 12px; color: var(--profile-accent); }
.owner-profile-stats strong { display: block; font-size: 1.7rem; line-height: 1; letter-spacing: -.04em; }
.owner-profile-stats span { display: block; margin-top: 8px; color: var(--profile-muted); font-size: .82rem; overflow-wrap: anywhere; }
#tab-profil .owner-profile-card p { color: var(--profile-muted); font-size: .85rem; line-height: 1.5; }
.owner-profile-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#tab-profil .owner-profile-danger { background: var(--profile-danger-bg); border-color: var(--profile-danger); }
#tab-profil .owner-profile-danger h3 { color: var(--profile-danger); }
#tab-profil .owner-profile-danger .btn-secondary { color: var(--profile-danger); border: 1px solid var(--profile-danger); background: transparent; }
#tab-profil .owner-profile-danger .btn-secondary:hover { background: var(--profile-surface); }
#tab-profil :is(button, input, textarea, select):focus-visible { outline: 3px solid var(--profile-accent); outline-offset: 2px; }
@media (max-width: 1024px) {
  #ownerProfileContent { grid-template-columns: minmax(0, 1fr); grid-template-areas: "identity" "stats" "settings" "password" "account" "danger"; }
}
@media (max-width: 480px) {
  .owner-profile-grid { grid-template-columns: minmax(0, 1fr); }
  .owner-profile-stats { grid-template-columns: 1fr; }
  .owner-profile-stats div { display: grid; grid-template-columns: 24px auto 1fr; align-items: center; gap: 12px; }
  .owner-profile-stats svg, .owner-profile-stats i, .owner-profile-stats span { margin: 0; }
  .owner-profile-avatar-actions { padding-top: 0; }
  .owner-profile-summary { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #tab-profil .owner-profile-card button, .owner-profile-upload, .owner-profile-segments span { transition: none; }
}
