:root{
  --profile-accent:#2f84d9;
  --profile-accent-strong:#185fa9;
  --profile-accent-soft:#76b8ff;
  --profile-surface:#ffffff;
  --profile-surface-alt:#f4f8fd;
  --profile-surface-strong:#eef5fc;
  --profile-border:#cfe0f0;
  --profile-border-strong:#9fc0dd;
  --profile-text:#18324a;
  --profile-text-soft:#56718a;
  --profile-button-secondary-bg:#f4f8fd;
  --profile-button-secondary-text:#1b568f;
  --profile-input-bg:#ffffff;
  --profile-input-border:#b9d0e5;
  --profile-input-text:#18324a;
  --profile-shadow:0 18px 42px rgba(12, 42, 73, 0.12);
}

:root[data-theme="dark"]{
  --profile-accent:#5aa8ff;
  --profile-accent-strong:#236fbf;
  --profile-accent-soft:#86c1ff;
  --profile-surface:#122233;
  --profile-surface-alt:#17304a;
  --profile-surface-strong:#10283f;
  --profile-border:#2d5d87;
  --profile-border-strong:#5fafe7;
  --profile-text:#f2f7ff;
  --profile-text-soft:#a9c2dc;
  --profile-button-secondary-bg:rgba(20, 48, 74, 0.7);
  --profile-button-secondary-text:#d9ecff;
  --profile-input-bg:#0f2235;
  --profile-input-border:#2d5d87;
  --profile-input-text:#f2f7ff;
  --profile-shadow:0 18px 42px rgba(4, 20, 38, 0.24);
}

.profile-shell{
  max-width:1320px;
  padding-top:18px;
  padding-bottom:40px;
}

.profile-hero{
  display:block;
  margin-bottom:18px;
}

.profile-hero-copy{
  max-width:820px;
}

.profile-eyebrow{
  margin:0 0 8px;
  color:var(--profile-accent-soft);
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.profile-hero h1{
  margin:0;
  color:var(--profile-text);
  font-size:clamp(2rem, 3vw, 2.7rem);
  line-height:1.08;
  max-width:16ch;
  text-wrap:balance;
}

.profile-hero-text{
  margin:12px 0 0;
  max-width:58ch;
  color:var(--profile-text-soft);
  font-size:1rem;
  line-height:1.5;
}

.profile-layout{
  display:grid;
  grid-template-columns:280px minmax(0, 920px);
  justify-content:center;
  gap:28px;
  align-items:start;
  min-width:0;
}

.profile-layout-single{
  grid-template-columns:minmax(0, 920px);
}

.profile-sidebar,
.profile-main{
  display:grid;
  gap:24px;
  min-width:0;
}

.profile-sidebar{
  align-self:start;
  position:sticky;
  top:120px;
  gap:16px;
}

.profile-panel-shell{
  align-self:start;
  min-width:0;
  max-width:920px;
}

.profile-panel{
  display:grid;
  gap:18px;
  min-width:0;
}

.profile-card{
  margin-bottom:0;
  border-radius:24px;
  overflow:hidden;
  background:var(--profile-surface);
  border-color:var(--profile-border);
  box-shadow:var(--profile-shadow);
}

.profile-identity-card{
  position:relative;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--profile-accent-soft) 22%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--profile-surface-strong) 55%, transparent), transparent),
    var(--profile-surface);
}

.profile-hero-card{
  display:grid;
  align-content:start;
  gap:0;
}

.profile-main-summary{
  padding-bottom:6px;
}

.profile-main-summary-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.profile-main-summary-grid{
  display:grid;
  grid-template-columns:minmax(320px, 420px) minmax(240px, 320px);
  justify-content:space-between;
  gap:18px;
  align-items:start;
}

.profile-summary-subcard{
  display:grid;
  gap:16px;
  padding:18px;
  border:1px solid color-mix(in srgb, var(--profile-border) 82%, transparent);
  border-radius:18px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--profile-surface-alt) 88%, transparent), var(--profile-surface));
}

.profile-summary-note{
  align-content:start;
}

.profile-summary-note h3{
  margin:0;
  color:var(--profile-text);
  font-size:1.2rem;
  line-height:1.2;
}

.profile-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:18px;
}

.profile-card-kicker{
  margin:0 0 6px;
  color:var(--profile-accent);
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.profile-card h2{
  margin:0;
  color:var(--profile-text);
  font-size:2.15rem;
  line-height:1.1;
}

.profile-provider-badge{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:6px 12px;
  border:1px solid color-mix(in srgb, var(--profile-border-strong) 70%, transparent);
  border-radius:999px;
  background:color-mix(in srgb, var(--profile-accent-soft) 16%, var(--profile-surface));
  color:var(--profile-button-secondary-text);
  font-size:12px;
  font-weight:700;
  text-align:center;
}

.profile-identity-summary{
  display:grid;
  grid-template-columns:64px minmax(0, 1fr);
  gap:14px;
  align-items:center;
  margin-bottom:20px;
}

.profile-avatar{
  display:grid;
  place-items:center;
  width:64px;
  height:64px;
  border-radius:20px;
  background:linear-gradient(135deg, #7dc0ff, #2b77c9);
  color:#07192d;
  font-size:30px;
  font-weight:800;
  box-shadow:0 16px 30px rgba(0,0,0,.22);
}

.profile-display-name{
  margin:0;
  color:var(--profile-text);
  font-size:1.25rem;
  font-weight:800;
}

.profile-display-meta{
  margin:4px 0 0;
  color:var(--profile-text-soft);
  overflow-wrap:anywhere;
}

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

.profile-grid dt{
  margin:0;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-weight:700;
  color:var(--profile-text-soft);
}

.profile-grid dd{
  margin:6px 0 0;
  color:var(--profile-text);
  font-size:15px;
  font-weight:600;
  overflow-wrap:anywhere;
}

.profile-form{
  display:grid;
  gap:18px;
  min-width:0;
}

.profile-fields{
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:16px;
  min-width:0;
}

.profile-field{
  display:grid;
  gap:8px;
  padding:16px;
  border:1px solid color-mix(in srgb, var(--profile-border) 82%, transparent);
  border-radius:18px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--profile-surface-alt) 88%, transparent), var(--profile-surface));
  grid-column:span 2;
  min-width:0;
}

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

.profile-field-compact{
  grid-column:span 3;
}

.profile-form label{
  margin:0;
  color:var(--profile-text);
  font-size:13px;
  font-weight:800;
  letter-spacing:.03em;
}

.profile-form input,
.profile-form select,
.profile-form textarea{
  width:100%;
  max-width:100%;
  min-height:48px;
  padding:12px 14px;
  border:1px solid var(--profile-input-border);
  border-radius:14px;
  background:var(--profile-input-bg);
  color:var(--profile-input-text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.04);
  font-size:15px;
  box-sizing:border-box;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.profile-form textarea{
  min-height:120px;
  resize:vertical;
  font-family:inherit;
}

.profile-search-select{
  position:relative;
}

.profile-search-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  max-height:240px;
  overflow:auto;
  padding:8px;
  border:1px solid var(--profile-input-border);
  border-radius:16px;
  background:var(--profile-surface);
  box-shadow:var(--profile-shadow);
  z-index:30;
}

.profile-search-option{
  display:block;
  width:100%;
  padding:10px 12px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--profile-text);
  text-align:left;
  font:inherit;
  cursor:pointer;
}

.profile-search-option:hover,
.profile-search-option:focus-visible{
  background:color-mix(in srgb, var(--profile-accent-soft) 18%, var(--profile-surface-alt));
  outline:none;
}

.profile-form input::placeholder,
.profile-form textarea::placeholder{
  color:color-mix(in srgb, var(--profile-text-soft) 82%, transparent);
}

.profile-form input:hover,
.profile-form select:hover,
.profile-form textarea:hover{
  border-color:var(--profile-border-strong);
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus{
  outline:none;
  border-color:var(--profile-accent);
  box-shadow:0 0 0 4px rgba(69, 145, 219, 0.18);
  background:color-mix(in srgb, var(--profile-input-bg) 82%, var(--profile-surface-alt));
}

.profile-help-text{
  margin:0;
  color:var(--profile-text-soft);
  line-height:1.6;
}

.profile-page .alert,
.admin-page .alert{
  margin:0 0 16px;
  padding:12px 14px;
  border:1px solid #d7c07a;
  border-radius:12px;
  background:#fff4cf;
  color:#5f4a12;
}

.profile-page .alert.batch-inline-error,
.admin-page .alert.batch-inline-error{
  border-color:#e4a4a4;
  background:#fde7e7;
  color:#7f1d1d;
}

.profile-page .alert.batch-inline-success,
.admin-page .alert.batch-inline-success{
  border-color:#91cf9c;
  background:#e8f7eb;
  color:#18572c;
}

:root[data-theme="dark"] .profile-page .alert,
:root[data-theme="dark"] .admin-page .alert{
  border-color:#8b6d1f;
  background:#4d3e16;
  color:#f8e7a8;
}

:root[data-theme="dark"] .profile-page .alert.batch-inline-error,
:root[data-theme="dark"] .admin-page .alert.batch-inline-error{
  border-color:#8c4a52;
  background:#4a252a;
  color:#ffd3d7;
}

:root[data-theme="dark"] .profile-page .alert.batch-inline-success,
:root[data-theme="dark"] .admin-page .alert.batch-inline-success{
  border-color:#2f7a49;
  background:#183623;
  color:#c4f0cf;
}

.profile-form-section{
  display:grid;
  gap:14px;
  padding:18px;
  border:1px solid color-mix(in srgb, var(--profile-border) 78%, transparent);
  border-radius:20px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--profile-surface-strong) 32%, transparent), var(--profile-surface));
}

.profile-form-section-head{
  display:grid;
  gap:4px;
}

.profile-form-section-head h3{
  margin:0;
  color:var(--profile-text);
  font-size:1.08rem;
  line-height:1.2;
}

.profile-help-card,
.profile-details-card{
  align-self:start;
}

.profile-nav-card{
  gap:.85rem;
  padding:14px 14px 16px;
  border-radius:20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--profile-surface-strong) 52%, transparent), transparent 26%),
    var(--profile-surface);
}

.profile-section-nav{
  display:grid;
  gap:.45rem;
}

.profile-section-nav .profile-secondary-action{
  width:100%;
}

.profile-nav-button{
  cursor:pointer;
  justify-content:flex-start;
  min-height:42px;
  padding:0 16px;
  border-radius:14px;
  font-size:13px;
  letter-spacing:.01em;
}

.profile-nav-button.is-active{
  border-color:var(--profile-accent);
  background:linear-gradient(135deg, color-mix(in srgb, var(--profile-accent) 18%, var(--profile-surface)), color-mix(in srgb, var(--profile-accent-strong) 12%, var(--profile-surface)));
  color:var(--profile-text);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--profile-accent) 18%, transparent);
}

.profile-nav-card .profile-card-head{
  margin-bottom:10px;
}

.profile-nav-card .profile-card-kicker{
  margin-bottom:4px;
}

.profile-nav-card h2{
  font-size:1.15rem;
  line-height:1.15;
}

.profile-detail-list{
  display:grid;
  gap:.75rem;
}

.profile-management-toolbar{
  display:flex;
  gap:12px;
  align-items:center;
}

.profile-management-toolbar input{
  flex:1 1 auto;
  min-height:46px;
  padding:12px 14px;
  border:1px solid var(--profile-input-border);
  border-radius:14px;
  background:var(--profile-input-bg);
  color:var(--profile-input-text);
}

.profile-management-table-wrap{
  overflow:auto;
  border:1px solid color-mix(in srgb, var(--profile-border) 70%, transparent);
  border-radius:18px;
}

.profile-management-pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.profile-management-pagination .profile-secondary-action{
  min-height:40px;
}

.profile-management-table{
  min-width:720px;
}

.profile-management-meta{
  margin-top:6px;
  color:var(--profile-text-soft);
}

.profile-management-delete{
  min-height:40px;
  padding:0 16px;
}

body[data-table-density="compact"] .profile-management-table th,
body[data-table-density="compact"] .profile-management-table td{
  padding-top:10px;
  padding-bottom:10px;
}

.profile-field-help{
  margin:0;
  color:var(--profile-text-soft);
  font-size:12px;
  line-height:1.45;
}

.profile-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
  padding-top:2px;
}

.profile-primary-action,
.profile-secondary-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:0 20px;
  border-radius:999px;
  text-decoration:none;
  font-size:14px;
  font-weight:800;
  letter-spacing:.02em;
  transition:transform .15s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.profile-primary-action{
  border:1px solid var(--profile-accent);
  background:linear-gradient(135deg, var(--profile-accent), var(--profile-accent-strong));
  color:#f7fbff;
  box-shadow:0 14px 28px rgba(10, 47, 83, 0.28);
}

.profile-primary-action:hover,
.profile-primary-action:focus-visible{
  background:linear-gradient(135deg, color-mix(in srgb, var(--profile-accent) 88%, white), color-mix(in srgb, var(--profile-accent-strong) 92%, white));
  color:#ffffff;
  transform:translateY(-1px);
}

.profile-secondary-action{
  border:1px solid color-mix(in srgb, var(--profile-border-strong) 70%, transparent);
  background:var(--profile-button-secondary-bg);
  color:var(--profile-button-secondary-text);
}

.profile-secondary-action:hover,
.profile-secondary-action:focus-visible{
  background:color-mix(in srgb, var(--profile-accent-soft) 18%, var(--profile-button-secondary-bg));
  border-color:var(--profile-border-strong);
  color:#ffffff;
}

.profile-settings-card{
  min-width:0;
}

.profile-hero-actions{
  padding-top:18px;
}

@media (max-width: 980px){
  .profile-layout{
    grid-template-columns:1fr;
    justify-content:stretch;
  }

  .profile-sidebar{
    position:static;
    top:auto;
  }

  .profile-main-summary-grid{
    grid-template-columns:1fr;
  }

  .profile-fields{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .profile-field,
  .profile-field-compact{
    grid-column:span 1;
  }

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

@media (max-width: 760px){
  .profile-shell{
    padding-top:16px;
  }

  .profile-management-toolbar{
    flex-direction:column;
    align-items:stretch;
  }

  .profile-management-pagination{
    flex-direction:column;
    align-items:stretch;
  }

  .profile-hero h1{
    max-width:none;
    font-size:clamp(2rem, 8.6vw, 2.75rem);
  }

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

  .profile-field,
  .profile-field-compact,
  .profile-field-wide{
    grid-column:auto;
  }

  .profile-card-head,
  .profile-identity-summary{
    grid-template-columns:1fr;
    display:grid;
  }

  .profile-main-summary-head{
    grid-template-columns:1fr;
    display:grid;
  }

  .profile-provider-badge{
    justify-self:start;
  }

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

  .profile-primary-action,
  .profile-secondary-action{
    width:100%;
  }
}

@media (max-width: 520px){
  .profile-card{
    border-radius:20px;
  }

  .profile-field{
    padding:14px;
    border-radius:16px;
  }

  .profile-form input,
  .profile-form select,
  .profile-form textarea{
    min-height:46px;
    padding:11px 12px;
    font-size:16px;
  }
}
