:root {
  --navy: #16273F;
  --red: #E8402A;
  --grey: #8791A0;
  --line: #EAEDF3;
  --bg: #F4F6FA;
  --green: #1FA97A;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-family: "Mulish", system-ui, -apple-system, sans-serif; color: #33414F; }
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* Constrain the shared header/footer to the same 90% width as the page
   content, matching every other suite app (default chrome is 1440px). */
.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

/* Header extras */
.og-env-badge {
  margin-left: 10px; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 0.4px; color: #7A5AF0; background: #F1EEFC; border: 1px solid #E0D8F8;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.rm-header-right { display: flex; align-items: center; gap: 14px; }
#headerRight[hidden] { display: none !important; }
.og-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: #16273F; color: #fff; font-family: "Poppins", sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: 0.5px;
}
.og-user { font-weight: 600; font-size: 14px; color: var(--navy); }
.og-logout {
  border: 1px solid var(--line); background: #fff; color: #5B6675; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-family: "Poppins", sans-serif;
}
.og-logout:hover { border-color: var(--red); color: var(--navy); }

.og-main { flex: 1; }
.og-notice { padding: 28px 32px; color: var(--grey); }
.og-error { color: var(--red); }

/* Login */
.og-login { display: flex; justify-content: center; padding: 60px 20px; }
.og-login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 40px;
  width: 100%; max-width: 440px; box-shadow: 0 10px 40px rgba(18, 38, 63, 0.08);
}
.og-login-card h1 { font-family: "Poppins", sans-serif; font-size: 26px; color: var(--navy); margin: 0 0 6px; }
.og-login-sub { color: var(--grey); font-size: 14px; margin: 0 0 24px; }
.og-field { display: block; margin-bottom: 16px; }
.og-field span { display: block; font-weight: 600; font-size: 13px; color: var(--navy); margin-bottom: 6px; }
.og-field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #FBFCFE;
}
.og-field input:focus { outline: 3px solid rgba(232, 64, 42, 0.25); border-color: var(--red); }
.og-login-error { color: var(--red); font-size: 13.5px; margin: 0 0 14px; }

.og-btn {
  border: none; border-radius: 999px; font-family: "Poppins", sans-serif; font-weight: 600;
  font-size: 15px; padding: 12px 22px; cursor: pointer;
}
.og-btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(232, 64, 42, 0.28); }
.og-btn-primary:hover { background: #D6371F; }
.og-btn-primary:disabled { opacity: 0.6; cursor: wait; }

/* Hero + search — title floats on the grey page bg, matching the suite
   (Domains / System Status heroes), not a white band. */
.og-hero { background: transparent; }
.og-hero-inner, .og-detail-inner, .og-results, .og-tab-body { max-width: 90%; margin: 0 auto; padding: 0 32px; }
.og-hero-inner { padding-top: 30px; padding-bottom: 22px; }
.og-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: -0.5px; color: var(--navy); margin: 0 0 6px; }
.og-sub { color: #5B6675; font-size: 15.5px; margin-bottom: 22px; }
.og-search { display: flex; gap: 12px; max-width: 620px; }
.og-search input {
  flex: 1; padding: 13px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px;
  font-family: inherit; background: #FBFCFE;
}
.og-search input:focus { outline: 3px solid rgba(232, 64, 42, 0.22); border-color: var(--red); }

.og-results { padding-top: 26px; padding-bottom: 40px; }
.og-org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.og-org-card {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(18, 38, 63, 0.04); transition: border-color 0.15s ease, transform 0.1s ease;
}
.og-org-card:hover { border-color: var(--red); }
.og-org-fav {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; background: #FBE7E2; color: var(--red);
  display: flex; align-items: center; justify-content: center; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 19px;
}
.og-org-fav-lg { width: 56px; height: 56px; font-size: 24px; }
.og-org-body { flex: 1; min-width: 0; display: block; }
.og-org-name { display: block; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 16px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.og-org-meta { display: block; font-size: 13px; color: var(--grey); margin-top: 2px; }

/* Detail */
.og-detail-head { background: #fff; border-bottom: 1px solid var(--line); }
.og-detail-inner { padding-top: 24px; }
.og-back {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
  color: var(--grey); font-weight: 600; font-size: 14px; font-family: "Poppins", sans-serif; padding: 0; margin-bottom: 16px;
}
.og-back:hover { color: var(--navy); }
.og-detail-id { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; }
.og-detail-name { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 28px; letter-spacing: -0.4px; color: var(--navy); margin: 0; }
.og-detail-meta { font-size: 13.5px; color: var(--grey); margin-top: 4px; }
.og-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

.og-tabs { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 6px; }
.og-tab {
  background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer;
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: 15px; color: var(--grey);
  padding: 12px 16px; margin-bottom: -1px;
}
.og-tab:hover { color: var(--navy); }
.og-tab.active { color: var(--red); border-bottom-color: var(--red); }

.og-tab-body { padding-top: 24px; padding-bottom: 44px; }
.og-list { display: flex; flex-direction: column; gap: 12px; }
.og-row {
  display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 20px; box-shadow: 0 3px 10px rgba(18, 38, 63, 0.03);
}
.og-row-main { flex: 1; min-width: 0; }
.og-row-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15.5px; color: var(--navy); }
.og-row-desc { font-size: 13px; color: var(--grey); margin-top: 3px; }
.og-pill { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.og-pill-beta { background: #F1EEFC; color: #7A5AF0; }

/* Toggle switch */
.og-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.og-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.og-switch-track { position: absolute; inset: 0; background: #D5DAE3; border-radius: 999px; transition: background 0.18s ease; }
.og-switch-track::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.18s ease;
}
.og-switch input:checked + .og-switch-track { background: var(--green); }
.og-switch input:checked + .og-switch-track::before { transform: translateX(20px); }
.og-switch input:disabled + .og-switch-track { opacity: 0.6; }
.og-switch input:focus-visible + .og-switch-track { outline: 3px solid rgba(31, 169, 122, 0.35); outline-offset: 2px; }

/* People */
.og-people-invite { margin-bottom: 18px; }
.og-invite-form { display: flex; gap: 10px; }
.og-invite-form input { flex: 1; max-width: 340px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-family: inherit; background: #FBFCFE; }
.og-invite-form select, .og-role {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-family: inherit;
  background: #fff; color: var(--navy); cursor: pointer;
}
.og-remove {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--grey); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.og-remove:hover { color: var(--red); border-color: #F3C6BF; background: #FCECEA; }

/* Flash toast */
.og-flash {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14px; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 90;
  box-shadow: 0 10px 30px rgba(18, 38, 63, 0.22);
}
.og-flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.og-flash-ok { background: var(--green); }
.og-flash-err { background: var(--red); }

@media (max-width: 720px) {
  .og-hero-inner, .og-detail-inner, .og-results, .og-tab-body, .og-tabs { padding-left: 18px; padding-right: 18px; }
  .og-invite-form { flex-wrap: wrap; }
}
