:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --border:#e6e9f2;
  --text:#111827;
  --muted:#6b7280;
  --primary:#2563eb;
  --hover:#eef2ff;
  --shadow:0 12px 28px rgba(15,23,42,0.06);
}
*{box-sizing:border-box;}
body.orgprofile-page{
  margin:0;
  font-family:"Inter", Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}
.settings-top{
  position:sticky;
  top:0;
  z-index:10;
  background:#f9fafc;
  display:grid;
  grid-template-columns:1fr minmax(340px,520px) auto;
  align-items:center;
  gap:16px;
  padding:16px 28px;
  border-bottom:1px solid var(--border);
}
.settings-meta{display:flex;align-items:center;gap:10px;}
.settings-icon{
  width:36px;height:36px;border-radius:10px;
  background:#fef2f2;color:#dc2626;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:16px;
}
.settings-back{
  width:32px;
  height:32px;
  border-radius:8px;
  border:1px solid var(--border);
  background:#fff;
  color:#6b7280;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.settings-title{font-weight:800;font-size:18px;}
.settings-sub{color:var(--muted);font-size:13px;}
.settings-search{
  display:flex;align-items:center;gap:10px;
  background:#fff;
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:12px;
  box-shadow:0 10px 24px rgba(0,0,0,0.04);
}
.settings-search input{border:none;background:transparent;outline:none;width:100%;font-size:14px;}
.settings-close{
  justify-self:end;
  background:#fff;
  border:1px solid var(--border);
  color:var(--muted);
  text-decoration:none;
  padding:9px 12px;
  border-radius:10px;
  font-weight:600;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.close-x{color:#ef4444;font-weight:800;}

.profile-layout{
  display:grid;
  grid-template-columns:280px 1fr;
  gap:16px;
  max-width:100%;
  margin:0;
  padding:0 18px 40px 0;
}
.profile-sidebar{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:0;
  padding:10px 6px;
  min-height:calc(100vh - 64px);
  height:calc(100vh - 64px);
  box-shadow:none;
  position:sticky;
  top:64px;
  max-height:calc(100vh - 64px);
  overflow-y:scroll;
  scrollbar-width:thin;
  scrollbar-color:#cbd5e1 transparent;
}
.profile-sidebar::-webkit-scrollbar{width:10px;}
.profile-sidebar::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:8px;
}
.profile-sidebar::-webkit-scrollbar-track{
  background:transparent;
}
.side-section-title{
  font-size:11px;
  text-transform:uppercase;
  color:#9aa1ad;
  font-weight:700;
  padding:4px 8px 4px;
  letter-spacing:.4px;
}
.side-group{display:flex;flex-direction:column;gap:2px;margin-bottom:8px;}
.side-group-toggle{
  background:transparent;
  border:none;
  text-align:left;
  padding:5px 8px 3px 8px;
  font-weight:700;
  font-size:12.5px;
  color:#111827;
  cursor:default;
  display:flex;
  align-items:center;
  gap:6px;
}
.side-link{
  display:block;
  padding:5px 8px;
  border-radius:5px;
  color:#1f2937;
  text-decoration:none;
  font-weight:600;
  font-size:12.5px;
  transition:background .15s ease,color .15s ease;
}
.side-link:hover{background:#f3f4f6;color:#111827;}
.side-link.child{padding-left:24px;}
.side-link.active{
  background:#3b82f6;
  color:#fff;
  box-shadow:none;
}
.side-link.group-link{
  display:flex;
  align-items:center;
  gap:8px;
  color:#1f2937;
  font-weight:600;
  padding-left:8px;
}
.caret{
  width:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#9aa1ad;
  font-size:11px;
}
.caret.down{color:#6b7280;}

.profile-main{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.profile-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px 18px;
  box-shadow:var(--shadow);
}
.profile-head h1{margin:0;font-size:20px;}
.org-id{color:var(--muted);font-size:13px;}
.profile-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px 18px;
  box-shadow:var(--shadow);
}
.profile-card h2{margin:0 0 8px;font-size:16px;}
.field-group{margin-top:12px;}
.field-group label{font-weight:700;font-size:13px;}
.req{color:#ef4444;}
.hint{color:var(--muted);font-size:13px;margin:4px 0 10px;}
.field-group input,
.profile-card input,
.profile-card select{
  width:100%;
  height:40px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 12px;
  background:#fff;
  font-size:14px;
}
.profile-card input + input{margin-top:10px;}
.grid-two{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px;
}
.grid-three{
  display:grid;
  grid-template-columns:1.2fr 1fr 1fr;
  gap:12px;
  margin-top:10px;
}
.logo-block{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:14px;
  align-items:start;
}
.logo-upload{
  border:2px dashed #d8dce6;
  border-radius:12px;
  height:100px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  color:#9aa1ad;
  font-weight:700;
  font-size:12px;
}
.logo-note{font-size:13px;color:#374151;}
.logo-meta{margin-top:8px;color:#6b7280;font-size:12px;}
.address-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  width:320px;
  position:relative;
  background:#fff;
  box-shadow:0 10px 22px rgba(15,23,42,0.05);
}
.address-title{font-weight:700;margin-bottom:8px;}
.address-meta{color:#6b7280;font-size:13px;margin-top:4px;}
.address-change{
  position:absolute;
  top:14px;
  right:14px;
  color:#1d4ed8;
  text-decoration:none;
  font-size:13px;
  font-weight:600;
}
.contact-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.contact-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  background:#fff;
}
.contact-card h3{margin:0 0 8px;font-size:14px;}
.contact-row{display:flex;gap:10px;align-items:center;margin-top:10px;}
.contact-icon{
  width:36px;height:36px;border-radius:50%;
  background:#fef3c7;color:#d97706;
  display:inline-flex;align-items:center;justify-content:center;
}
.muted{color:var(--muted);font-size:13px;}
.info-banner{
  margin-top:12px;
  display:flex;
  gap:10px;
  background:#eef7ff;
  border:1px solid #d7e9ff;
  border-radius:10px;
  padding:12px;
  font-size:13px;
  color:#1f2937;
}
.info-banner a{color:#1d4ed8;text-decoration:none;font-weight:600;}
.config-link{
  display:inline-block;
  margin-top:10px;
  color:#1d4ed8;
  text-decoration:none;
  font-weight:600;
  font-size:13px;
}
.profile-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.save-btn{
  background:#3b82f6;
  color:#fff;
  border:none;
  border-radius:8px;
  padding:8px 16px;
  font-weight:700;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.required-note{color:#ef4444;font-size:12px;}
.toolbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
}
.alert-err{
  background:#fce8e6;
  border:1px solid #f4b6b6;
  border-radius:10px;
  padding:14px 18px;
  margin:16px 0;
  color:#d93025;
  font-size:13px;
}
.alert-err ul{margin:8px 0 0 20px;}
.alert-err-title{font-weight:700;}
.alert-ok{
  background:#e6f4ea;
  border:1px solid #b2e7bb;
  border-radius:10px;
  padding:12px 18px;
  margin:16px 0;
  color:#137333;
  font-size:13px;
}

@media (max-width: 1024px){
  .profile-layout{grid-template-columns:1fr;}
  .profile-sidebar{position:relative;}
  .grid-two,.grid-three,.contact-grid{grid-template-columns:1fr;}
  .logo-block{grid-template-columns:1fr;}
}
