/* ============================================================
   giixi onboarding / org-management — dark enterprise design system
   Ported from the Claude Design "Onboarding" bundle.

   SCOPING: every rule lives under `.orgx` so it cannot touch the rest
   of the app. Classes that collide with globally-loaded Bootstrap
   (btn / card / badge / modal / overlay) are renamed `ox-*` so Bootstrap's
   own defaults (e.g. `.modal{display:none}`) can never leak in.

   Fonts: Space Grotesk (display) · Hanken Grotesk (UI) · JetBrains Mono (codes)
   ============================================================ */

.orgx {
  /* ---- surfaces (cool near-neutral ink) ---- */
  --bg-0: oklch(0.165 0.012 264);
  --bg-1: oklch(0.205 0.014 264);
  --bg-2: oklch(0.225 0.015 264);
  --bg-3: oklch(0.255 0.016 264);
  --bg-4: oklch(0.295 0.018 264);

  /* ---- borders ---- */
  --line:      oklch(0.32 0.016 264);
  --line-soft: oklch(0.275 0.014 264);
  --line-strong: oklch(0.40 0.02 264);

  /* ---- text ---- */
  --tx-hi:  oklch(0.97 0.004 264);
  --tx-mid: oklch(0.76 0.012 264);
  --tx-lo:  oklch(0.60 0.014 264);
  --tx-dim: oklch(0.48 0.014 264);

  /* ---- accent (references central indigo tokens) ---- */
  --ac:      var(--accent);
  --ac-hi:   var(--accent-hi);
  --ac-dim:  var(--accent-soft);
  --ac-line: var(--accent-line);
  --ac-ink:  var(--accent-ink);

  /* ---- semantics ---- */
  --ok:      oklch(0.72 0.14 158);
  --ok-dim:  oklch(0.72 0.14 158 / 0.15);
  --ok-line: oklch(0.72 0.14 158 / 0.4);

  --warn:     oklch(0.79 0.13 78);
  --warn-dim: oklch(0.79 0.13 78 / 0.15);
  --warn-line:oklch(0.79 0.13 78 / 0.4);

  --bad:      oklch(0.66 0.18 22);
  --bad-dim:  oklch(0.66 0.18 22 / 0.15);
  --bad-line: oklch(0.66 0.18 22 / 0.42);

  /* ---- type ---- */
  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-ui: "Hanken Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  /* ---- radii ---- */
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* ---- shadow ---- */
  --sh-1: 0 1px 2px oklch(0 0 0 / 0.3);
  --sh-2: 0 8px 24px -8px oklch(0 0 0 / 0.5);
  --sh-3: 0 24px 60px -16px oklch(0 0 0 / 0.62);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  color: var(--tx-mid);
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;



  
}

.orgx, .orgx *, .orgx *::before, .orgx *::after { box-sizing: border-box; }

.orgx ::selection { background: var(--ac-dim); color: var(--tx-hi); }

.orgx ::-webkit-scrollbar { width: 11px; height: 11px; }
.orgx ::-webkit-scrollbar-thumb {
  background: var(--bg-4); border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
}
.orgx ::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: content-box; }

.orgx h1, .orgx h2, .orgx h3, .orgx h4 {
  font-family: var(--f-display); color: var(--tx-hi);
  font-weight: 600; letter-spacing: -0.02em; margin: 0;
}
.orgx .mono { font-family: var(--f-mono); font-feature-settings: "ss01"; }
.orgx button { font-family: inherit; cursor: pointer; }
.orgx input, .orgx select, .orgx textarea { font-family: inherit; }
.orgx a { color: var(--ac-hi); }

/* ---- page ---- */
.orgx .page { padding: 30px 4px 80px; width: 100%; margin: 0 auto; }
.orgx .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.orgx .page-title { font-size: 27px; }
.orgx .page-sub { color: var(--tx-lo); font-size: 14.5px; margin-top: 5px; }
.orgx .crumb-link { background: none; border: none; color: var(--tx-lo); font-size: 14px; padding: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.orgx .crumb-link:hover { color: var(--tx-mid); }

/* ============================================================ BUTTONS */
/* Reset the legacy global `button { width:100%; margin-top:1.5rem; padding:0.75rem;
   background-color; ... }` from style.css so it cannot leak into this scoped design
   system. Without this, every orgx <button> inherits width:100%, which as a flex item
   makes its basis the full row width and collapses the flex:1 sibling (LEI input,
   team-head text, etc.) to zero. Mirrors the same reset used by `.ir-module button`. */
.orgx button {
  width: auto;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-weight: inherit;
}
.orgx button:hover { background: transparent; }

.orgx .ox-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.06s, box-shadow 0.15s;
  color: var(--tx-mid); background: transparent; line-height: 1;
}
.orgx .ox-btn:active { transform: translateY(0.5px); }
.orgx .ox-btn svg { flex-shrink: 0; }

.orgx .ox-btn-primary { background: var(--ac); color: var(--ac-ink); box-shadow: 0 1px 0 oklch(1 0 0 / 0.12) inset, 0 4px 14px -4px var(--ac); }
.orgx .ox-btn-primary:hover { background: var(--ac-hi); color: var(--ac-ink); }
.orgx .ox-btn-primary:disabled, .orgx .ox-btn-primary[disabled] { background: var(--bg-3); color: var(--tx-dim); box-shadow: none; cursor: not-allowed; }

.orgx .ox-btn-ghost { background: var(--bg-2); border-color: var(--line); color: var(--tx-hi); }
.orgx .ox-btn-ghost:hover { background: var(--bg-3); border-color: var(--line-strong); color: var(--tx-hi); }
.orgx .ox-btn-ghost:disabled, .orgx .ox-btn-ghost[disabled] { opacity: 0.5; cursor: not-allowed; }

.orgx .ox-btn-quiet { background: transparent; color: var(--tx-lo); }
.orgx .ox-btn-quiet:hover { background: var(--bg-2); color: var(--tx-hi); }
.orgx .ox-btn-quiet:disabled, .orgx .ox-btn-quiet[disabled] { opacity: 0.4; cursor: not-allowed; }

.orgx .ox-btn-danger { background: var(--bad); color: oklch(0.99 0.01 22); box-shadow: 0 4px 14px -4px var(--bad); }
.orgx .ox-btn-danger:hover { filter: brightness(1.08); color: oklch(0.99 0.01 22); }
.orgx .ox-btn-danger-soft { background: var(--bad-dim); color: var(--bad); border-color: var(--bad-line); }
.orgx .ox-btn-danger-soft:hover { background: oklch(0.66 0.18 22 / 0.24); }

/* Confirmation-popup confirm button (confirm-modal.js, used app-wide) — flat,
   no glow shadow and no hover-brightness pop, regardless of danger/primary
   variant. Scoped to .confirm-modal-confirm specifically so every other
   .ox-btn-primary/.ox-btn-danger button in the app keeps its normal styling. */
.confirm-modal-panel .confirm-modal-confirm.ox-btn-primary,
.confirm-modal-panel .confirm-modal-confirm.ox-btn-danger {
  box-shadow: none;
}
.confirm-modal-panel .confirm-modal-confirm.ox-btn-primary:hover,
.confirm-modal-panel .confirm-modal-confirm.ox-btn-danger:hover {
  filter: none;
  box-shadow: none;
}

.orgx .ox-btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.orgx .ox-btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.orgx .ox-btn-icon { width: 34px; height: 34px; padding: 0; }
.orgx .ox-btn-block { width: 80%; }

/* ============================================================ CARD */
.orgx .ox-card { display: block; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.orgx .card-pad { padding: 22px 24px; }
.orgx .card-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line-soft); }
.orgx .card-head h3 { font-size: 16px; }
.orgx .card-head .sub { color: var(--tx-dim); font-size: 13.5px; font-weight: 500; font-family: var(--f-ui); }
.orgx .card-head .sub.req { color: var(--bad); }
/* Trailing action in a card header (e.g. Details → Edit). The header is a flex
   row, so auto margin is what pushes the control to the far edge. */
.orgx .card-head-action { margin-left: auto; }

/* ============================================================ FIELDS */
.orgx .field { display: flex; flex-direction: column; gap: 7px; }
.orgx .field-label { font-size: 13px; font-weight: 600; color: var(--tx-hi); display: flex; align-items: center; gap: 6px; }
.orgx .field-label .opt { color: var(--tx-dim); font-weight: 500; }
.orgx .field-label .req-dot { color: var(--ac); }
.orgx .field-help { font-size: 12.5px; color: var(--tx-lo); line-height: 1.45; }

.orgx .feature-codes-field > div { display: flex; flex-direction: column; gap: 10px; }
.orgx .feature-codes-field > div > div > label {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: 14px; font-weight: 600; color: var(--tx-hi); cursor: pointer;
}
.orgx .feature-codes-field input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0; margin: 0; accent-color: var(--ac);
}

/* Plain boolean toggles (e.g. promo code / plan "Active" fields) inlined
   directly inside a .field-label — same sizing as .feature-codes-field's
   checkboxes above, so every checkbox in the orgx system looks consistent
   instead of falling back to the unstyled native box. */
.orgx .ox-switch-input {
  width: 16px; height: 16px; flex-shrink: 0; margin: 0; accent-color: var(--ac); cursor: pointer;
}

.orgx .inp {
  height: 40px; padding: 0 13px; width: 100%;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--tx-hi); font-size: 14px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.orgx .inp::placeholder { color: var(--tx-dim); }
.orgx .inp:hover { border-color: var(--line-strong); }
.orgx .inp:focus { outline: none; border-color: var(--ac); background: var(--bg-4); box-shadow: 0 0 0 3px var(--ac-dim); }
.orgx textarea.inp { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; min-height: 76px; }
.orgx .inp.mono { font-family: var(--f-mono); letter-spacing: 0.01em; }
.orgx .inp.locked { background: var(--bg-1); color: var(--tx-lo); cursor: not-allowed; border-style: dashed; }
.orgx .inp.bad { border-color: var(--bad-line); }
.orgx .inp.bad:focus { box-shadow: 0 0 0 3px var(--bad-dim); }

/* No custom chevron/appearance:none here on purpose — Windows Chrome/Edge
   reuse a custom-appearance <select>'s own background-image as the native
   popup's listbox background and tile it across every row when the
   dropdown opens. That's a native-popup rendering quirk, not something CSS
   can reliably override (background-size/!important on <option> both
   failed to stop it) — the only real fix is to not hand the browser a
   custom background to begin with. Falls back to the platform's own
   default select arrow instead. A custom-rendered (non-native-popup)
   dropdown, like GrcMultiselect for multi-selects, is the option if the
   custom chevron look is ever needed back for single-selects too.
*/
.orgx select.inp { cursor: pointer; padding-right: 12px; }

.orgx .inp-wrap { position: relative; display: flex; align-items: stretch; gap: 8px; }
.orgx .inp-wrap .inp { flex: 1; }
.orgx .inp-wrap > #btn-send-otp { height: auto; }

.orgx .err-line { font-size: 12.5px; color: var(--bad); display: flex; align-items: center; gap: 5px; }

.orgx .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.orgx .field-stack { display: flex; flex-direction: column; gap: 18px; }

/* ============================================================ BADGES */
.orgx .ox-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.005em;
  border: 1px solid transparent; white-space: nowrap; line-height: 1; vertical-align: middle;
}
.orgx .ox-badge .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.orgx .ox-badge-ac   { background: var(--ac-dim); color: var(--ac-hi); border-color: var(--ac-line); }
.orgx .ox-badge-ok   { background: var(--ok-dim); color: var(--ok); border-color: var(--ok-line); }
.orgx .ox-badge-warn { background: var(--warn-dim); color: var(--warn); border-color: var(--warn-line); }
.orgx .ox-badge-bad  { background: var(--bad-dim); color: var(--bad); border-color: var(--bad-line); }
.orgx .ox-badge-mute { background: var(--bg-3); color: var(--tx-lo); border-color: var(--line); }

/* ============================================================ KPI */
.orgx .kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.orgx .kpi { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 18px 20px; position: relative; overflow: hidden; }
.orgx .kpi .k-label { font-size: 12.5px; color: var(--tx-lo); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.orgx .kpi .k-val { font-family: var(--f-display); font-size: 32px; font-weight: 600; color: var(--tx-hi); margin-top: 8px; letter-spacing: -0.03em; }
.orgx .kpi .k-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-3); color: var(--tx-lo); }

/* ============================================================ TABLE */
.orgx .tbl-wrap { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow-x: auto; overflow-y: hidden; }
.orgx .tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.orgx .tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--tx-dim); font-weight: 600; padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft); background: var(--bg-1);
}
.orgx .tbl td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--tx-mid); vertical-align: middle; }
.orgx .tbl tr:last-child td { border-bottom: none; }
.orgx .tbl tbody tr { transition: background 0.12s; }
.orgx .tbl tbody tr:hover { background: var(--bg-3); }
.orgx .tbl .row-click { cursor: pointer; }
.orgx .tbl .org-name { color: var(--tx-hi); font-weight: 600; text-decoration: none; }
.orgx .tbl .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.orgx .cell-strong { color: var(--tx-hi); font-weight: 600; }
.orgx .cell-mono { font-family: var(--f-mono); font-size: 13px; color: var(--tx-mid); }

/* ============================================================ EMPTY */
.orgx .empty { text-align: center; padding: 64px 24px; }
.orgx .empty .e-ic { width: 56px; height: 56px; border-radius: 14px; background: var(--bg-3); display: grid; place-items: center; color: var(--tx-lo); margin: 0 auto 12px; border: 1px solid var(--line-soft); }
.orgx .empty h3 { font-size: 18px; }
.orgx .empty p { color: var(--tx-lo); font-size: 14px; max-width: 320px; margin: 4px auto 0; }

/* ============================================================ AVATAR */
.orgx .avatar { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; font-weight: 600; font-size: 13px; font-family: var(--f-display); color: var(--ac-ink); background: var(--ac); }
.orgx .avatar.sm { width: 28px; height: 28px; font-size: 12px; border-radius: 7px; }
.orgx .avatar.muted { background: var(--bg-4); color: var(--tx-mid); }

/* ============================================================ MODAL / OVERLAY */
/* A read-only drawer still opens and still shows the record, but offers no
   way to write it: its submit row goes, leaving Cancel/close. Set by
   templates/ciso/_components/drawer_shell.html when products_readonly. */
.orgx-overlay[data-readonly="1"] button[type="submit"],
.orgx-overlay[data-readonly="1"] .ox-btn-primary,
.orgx-overlay[data-readonly="1"] .ox-btn-danger {
  display: none;
}

.orgx-overlay {
  position: fixed; inset: 0; z-index: 1090;
  background: oklch(0.1 0.01 264 / 0.62); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: orgx-fade 0.2s ease;
}
@keyframes orgx-fade { from { opacity: 0; } to { opacity: 1; } }
.orgx-modal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--sh-3); width: 100%; max-width: 460px; overflow: hidden;
  animation: orgx-modal-in 0.3s var(--ease);
}
@keyframes orgx-modal-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ============================================================ SPINNER */
.orgx .spinner {
  width: 15px; height: 15px; border-radius: 99px; display: inline-block;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: orgx-spin 0.7s linear infinite; vertical-align: -2px;
}
@keyframes orgx-spin { to { transform: rotate(360deg); } }

/* ============================================================ LEI FEEDBACK */
.orgx .lei-feedback { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; padding: 8px 11px; border-radius: var(--r-sm); margin-top: 2px; }
.orgx .lei-feedback.ok { background: var(--ok-dim); color: var(--ok); border: 1px solid var(--ok-line); }
.orgx .lei-feedback.bad { background: var(--bad-dim); color: var(--bad); border: 1px solid var(--bad-line); }
.orgx .lei-feedback.checking { background: var(--bg-3); color: var(--tx-mid); border: 1px solid var(--line); }

/* ============================================================ DOMAIN CHIPS */
.orgx .domain-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.orgx .domain-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 12.5px; color: var(--tx-hi);
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 99px;
  padding: 4px 11px 4px 9px; animation: orgx-rise 0.25s var(--ease);
}
.orgx .domain-chip svg { color: var(--ac-hi); }
.orgx .domain-chip .sub { color: var(--tx-dim); font-family: var(--f-ui); font-size: 11px; }
@keyframes orgx-rise { from { transform: translateY(8px); } to { transform: none; } }

/* ============================================================ PASSWORD CHECKLIST */
.orgx .pw-checklist { display: grid; gap: 7px 16px; margin-top: 2px; }
.orgx .pw-checklist.vertical { grid-template-columns: 1fr; }
.orgx .pw-checklist.grid2 { grid-template-columns: 1fr 1fr; }
.orgx .pw-rule { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tx-lo); transition: color 0.2s; }
.orgx .pw-rule.pass { color: var(--ok); }
.orgx .pw-tick { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-3); border: 1px solid var(--line); color: transparent; transition: all 0.2s; }
.orgx .pw-rule.pass .pw-tick { background: var(--ok-dim); border-color: var(--ok-line); color: var(--ok); }
.orgx .pw-empty { width: 4px; height: 4px; border-radius: 99px; background: var(--tx-dim); }

/* ============================================================ TOGGLE SWITCH */
.orgx .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.orgx .toggle-row > span:first-child b { color: var(--tx-hi); font-size: 14px; font-weight: 600; }
.orgx .switch { width: 42px; height: 24px; border-radius: 99px; border: none; flex-shrink: 0; background: var(--bg-4); padding: 0; position: relative; transition: background 0.2s; }
.orgx .switch.on { background: var(--ac); }
.orgx .switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 99px; background: var(--tx-hi); transition: transform 0.2s var(--ease); box-shadow: var(--sh-1); }
.orgx .switch.on .knob { transform: translateX(18px); background: var(--ac-ink); }

/* ============================================================ FORM CHROME */
.orgx .pw-divider { display: flex; align-items: center; gap: 12px; color: var(--tx-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; margin-top: 2px; }
.orgx .pw-divider::before, .orgx .pw-divider::after { content: ""; height: 1px; background: var(--line-soft); flex: 1; }
.orgx .form-error { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--bad); background: var(--bad-dim); border: 1px solid var(--bad-line); border-radius: var(--r-sm); padding: 9px 13px; animation: orgx-rise 0.2s var(--ease); }
.orgx .form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ============================================================
   CREATE FLOW (flow.css)
   ============================================================ */
.orgx .create-shell { min-height: 100%; display: flex; flex-direction: column; }
.orgx .create-topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px; background: var(--bg-body);
  border-bottom: 1px solid var(--line-soft); margin: 0 -4px;
}
.orgx .ct-title { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; color: var(--tx-hi); font-size: 16px; }
.orgx .ct-title svg { color: var(--ac-hi); }

.orgx .create-layout { display: grid; grid-template-columns: 1fr 340px; gap: 36px; max-width: 1180px; width: 100%; margin: 0 auto; padding: 30px 4px 90px; align-items: start; }
.orgx .create-main { min-width: 0; }

/* ---- stepper ---- */
.orgx .stepper { display: flex; gap: 6px; margin-bottom: 30px; }
.orgx .stp { position: relative; display: flex; align-items: center; gap: 9px; background: none; border: none; padding: 4px 4px; flex: 1; color: var(--tx-lo); cursor: pointer; }
.orgx .stp-n { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-3); border: 1px solid var(--line); font-size: 13px; font-weight: 600; font-family: var(--f-mono); color: var(--tx-lo); transition: all 0.2s; }
.orgx .stp-l { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.orgx .stp-bar { flex: 1; height: 2px; background: var(--line-soft); border-radius: 99px; margin-left: 4px; min-width: 16px; }
.orgx .stp.active .stp-n { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); box-shadow: 0 0 0 4px var(--ac-dim); }
.orgx .stp.active { color: var(--tx-hi); }
.orgx .stp.done .stp-n { background: var(--ok-dim); border-color: var(--ok-line); color: var(--ok); }
.orgx .stp.done:not(.active) { color: var(--tx-mid); }
.orgx .stp:hover:not(.active) .stp-n { border-color: var(--line-strong); }

/* ---- section ---- */
@media (prefers-reduced-motion: no-preference) {
  .orgx .flow-sec { animation: orgx-secrise 0.32s var(--ease) both; }
}
@keyframes orgx-secrise { from { transform: translateY(8px); } to { transform: none; } }
.orgx .sec-head { margin: 28px 0 24px; }
.orgx .sec-head h2 { font-size: 22px; display: flex; align-items: center; gap: 12px; }
.orgx .sec-head p { color: var(--tx-lo); font-size: 14.5px; margin-top: 6px; max-width: 560px; text-wrap: pretty; }
.orgx .opt-tag { font-family: var(--f-ui); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tx-lo); background: var(--bg-3); border: 1px solid var(--line); padding: 3px 9px; border-radius: 99px; }

/* ---- linked allowlist <-> team ---- */
.orgx .link-block { display: flex; gap: 16px; align-items: flex-start; }
.orgx .link-num { width: 28px; height: 28px; border-radius: 99px; flex-shrink: 0; display: grid; place-items: center; background: var(--ac-dim); color: var(--ac-hi); border: 1px solid var(--ac-line); font-family: var(--f-mono); font-weight: 600; font-size: 13px; margin-top: 2px; }
.orgx .link-connector { display: flex; align-items: center; margin: 16px 0 16px 13px; }
.orgx .link-connector::before { content: ""; width: 2px; height: 22px; background: var(--line); border-radius: 9px; }
.orgx .link-connector span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tx-dim); font-weight: 600; margin-left: 16px; }

.orgx .team-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.orgx .team-head .th-text { flex: 1; min-width: 0; }

.orgx .hint-block { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--tx-lo); background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--r); padding: 13px 15px; }
.orgx .hint-block svg { color: var(--tx-lo); flex-shrink: 0; }

.orgx .team-empty { display: block; text-align: center; width: 100%; background: var(--bg-2); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 28px; color: var(--tx-lo); transition: all 0.15s; cursor: pointer; }
.orgx .team-empty:hover { border-color: var(--ac-line); background: var(--ac-dim); color: var(--ac-hi); }
.orgx .team-empty svg { color: var(--tx-lo); display: block; margin: 0 auto 8px; }
.orgx .team-empty:hover svg { color: var(--ac-hi); }
.orgx .team-empty b { color: var(--tx-hi); font-size: 15px; display: block; margin-bottom: 2px; }
.orgx .team-empty:hover b { color: var(--ac-hi); }
.orgx .team-empty span { font-size: 12.5px; display: block; }

.orgx .warn-block { background: var(--warn-dim); border: 1px solid var(--warn-line); border-radius: var(--r); padding: 13px 15px; margin-bottom: 14px; }
.orgx .wb-head { display: flex; align-items: center; gap: 8px; color: var(--warn); font-weight: 600; font-size: 13.5px; }
.orgx .warn-block p { color: var(--tx-mid); font-size: 13px; margin: 5px 0 0 23px; }

.orgx .member-list { display: flex; flex-direction: column; gap: 8px; }
.orgx .member-row { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; animation: orgx-rise 0.22s var(--ease); }
.orgx .member-row.bad { border-color: var(--bad-line); background: oklch(0.66 0.18 22 / 0.06); }
.orgx .m-id { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.orgx .m-id b { color: var(--tx-hi); font-size: 14px; font-weight: 600; }
.orgx .m-id .mono { font-family: var(--f-mono); font-size: 12px; color: var(--tx-lo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orgx .member-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }

/* ---- service pills ---- */
.orgx .svc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.orgx .svc-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 99px; color: var(--tx-mid); font-size: 13.5px; font-weight: 600; transition: all 0.15s; }
.orgx .svc-pill:not(.soon):hover { border-color: var(--line-strong); background: var(--bg-3); color: var(--tx-hi); }
.orgx .svc-pill.on { border-color: var(--ac); background: var(--ac-dim); color: var(--ac-hi); }
.orgx .svc-pill.soon { opacity: 0.55; cursor: not-allowed; padding-right: 10px; }
.orgx .svc-pill .sp-check { width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-3); border: 1px solid var(--line-strong); color: var(--ac-ink); transition: all 0.15s; }
.orgx .svc-pill.on .sp-check { background: var(--ac); border-color: var(--ac); }
.orgx .svc-pill.soon .sp-check { display: none; }
.orgx .svc-pill .sp-soon { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--tx-dim); background: var(--bg-3); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 5px; }

/* ---- footer nav ---- */
.orgx .flow-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.orgx .foot-note { font-size: 13px; color: var(--tx-lo); }

/* ---- summary rail ---- */
.orgx .create-rail { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 12px; }
.orgx .rail-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-2); }
.orgx .rail-org { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.orgx .ro-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ac-hi); flex-shrink: 0; }
.orgx .rail-org b { display: block; color: var(--tx-hi); font-size: 15px; font-weight: 600; font-family: var(--f-display); letter-spacing: -0.01em; line-height: 1.25; }
.orgx .rail-org span { font-size: 12.5px; color: var(--tx-lo); }

.orgx .rail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.orgx .rail-stats > div { text-align: center; }
.orgx .rs-n { display: block; font-family: var(--f-display); font-size: 22px; font-weight: 600; color: var(--tx-hi); }
.orgx .rs-l { font-size: 11px; color: var(--tx-lo); }

.orgx .rail-check { padding: 16px 0; }
.orgx .rc-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--tx-dim); font-weight: 600; margin-bottom: 11px; }
.orgx .rc-item { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--tx-lo); padding: 4px 0; transition: color 0.2s; }
.orgx .rc-item.ok { color: var(--tx-mid); }
.orgx .rc-item.warn { color: var(--warn); }
.orgx .rc-tick { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-3); border: 1px solid var(--line); color: transparent; transition: all 0.2s; }
.orgx .rc-item.ok .rc-tick { background: var(--ok-dim); border-color: var(--ok-line); color: var(--ok); }
.orgx .rc-item.warn .rc-tick { background: var(--warn-dim); border-color: var(--warn-line); color: var(--warn); }
.orgx .rail-foot { display: flex; gap: 8px; font-size: 12px; color: var(--tx-dim); line-height: 1.45; padding: 0 4px; }
.orgx .rail-foot svg { flex-shrink: 0; margin-top: 1px; }

@media (max-width: 940px) {
  .orgx .create-layout { grid-template-columns: 1fr; }
  .orgx .create-rail { position: static; }
}

/* ============================================================
   VIEWS (views.css) — list, detail, edit, delete
   ============================================================ */
.orgx .org-mark-sm { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--ac-hi); }
.orgx .org-mark-lg { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--ac-hi); box-shadow: var(--sh-1); }

.orgx .detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.orgx .dh-id { display: flex; gap: 16px; align-items: center; }
.orgx .dh-meta { display: flex; align-items: center; gap: 11px; margin-top: 7px; font-size: 13.5px; color: var(--tx-lo); flex-wrap: wrap; }
.orgx .dh-meta .mono { font-family: var(--f-mono); font-size: 13px; color: var(--tx-mid); }
.orgx .dot-sep { width: 3px; height: 3px; border-radius: 99px; background: var(--tx-dim); }

.orgx .blocked-banner { display: flex; align-items: center; gap: 14px; background: var(--bad-dim); border: 1px solid var(--bad-line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 22px; }
.orgx .bb-ic { width: 38px; height: 38px; border-radius: 10px; background: oklch(0.66 0.18 22 / 0.18); color: var(--bad); display: grid; place-items: center; flex-shrink: 0; }
.orgx .blocked-banner b { color: var(--tx-hi); font-size: 14.5px; }
.orgx .blocked-banner p { color: var(--tx-mid); font-size: 13px; margin: 3px 0 0; }

.orgx .detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 30px; }
.orgx .dt-row { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.orgx .dt-label { font-size: 12.5px; color: var(--tx-lo); font-weight: 600; }
.orgx .dt-val { font-size: 14px; color: var(--tx-hi); }
.orgx .dt-val .mono { font-family: var(--f-mono); font-size: 13px; }
.orgx .ext-link { color: var(--ac-hi); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.orgx .ext-link:hover { text-decoration: underline; }

.orgx .svc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--bg-3); border: 1px solid var(--line-soft); border-radius: var(--r); }
.orgx .svc-row b { color: var(--tx-hi); font-size: 14px; display: block; }
.orgx .svc-row span { font-size: 12px; color: var(--tx-lo); }

.orgx .members-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.orgx .count-pill { font-family: var(--f-mono); font-size: 13px; font-weight: 600; color: var(--ac-hi); background: var(--ac-dim); border: 1px solid var(--ac-line); padding: 1px 10px; border-radius: 99px; }
.orgx .cap-lock { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--tx-lo); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; }
.orgx .cap-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tx-lo); margin-bottom: 14px; }
.orgx .you-tag { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ac-hi); background: var(--ac-dim); border: 1px solid var(--ac-line); padding: 1px 6px; border-radius: 5px; margin-left: 8px; vertical-align: 1px; }

.orgx .del-modal { padding: 28px; text-align: center; }
.orgx .del-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 16px; }
.orgx .del-ic.bad { background: var(--bad-dim); color: var(--bad); border: 1px solid var(--bad-line); }
.orgx .del-ic.warn { background: var(--warn-dim); color: var(--warn); border: 1px solid var(--warn-line); }
.orgx .del-modal h3 { font-size: 19px; margin-bottom: 8px; }
.orgx .del-modal p { color: var(--tx-mid); font-size: 14px; line-height: 1.5; max-width: 360px; margin: 0 auto; text-wrap: pretty; }
.orgx .del-modal p b { color: var(--tx-hi); }
.orgx .del-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

@media (max-width: 880px) {
  .orgx .detail-grid { grid-template-columns: 1fr; }
}

/* search input on the list page */
.orgx .search-wrap { position: relative; max-width: 320px; margin-bottom: 14px; }
.orgx .search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx-dim); pointer-events: none; }
.orgx .search-wrap .inp { padding-left: 36px; }

/* ============================================================
   LIGHT OVERRIDE
   ponytail: light theme override block — appended, never rewrites the
   dark default above. Redefining the oklch token set on the scope flips
   every rule that consumes var() automatically; only the few literals
   that bypass tokens (select arrow SVG, sticky-topbar glass) need their
   own targeted light rules below. Drives regx/regulations via inheritance.
   ============================================================ */
[data-bs-theme="light"] .orgx {
  /* ---- surfaces (high-L, page lightest, raised surfaces step down) ---- */
  --bg-0: oklch(0.99 0 0);
  --bg-1: oklch(0.985 0.002 264);
  --bg-2: oklch(0.97 0.003 264);
  --bg-3: oklch(0.95 0.004 264);
  --bg-4: oklch(0.92 0.006 264);

  /* ---- borders (mid-high L) ---- */
  --line:      oklch(0.90 0.005 264);
  --line-soft: oklch(0.93 0.004 264);
  --line-strong: oklch(0.84 0.008 264);

  /* ---- text (low-L for contrast on white) ---- */
  --tx-hi:  oklch(0.22 0.01 264);
  --tx-mid: oklch(0.40 0.012 264);
  --tx-lo:  oklch(0.52 0.014 264);
  --tx-dim: oklch(0.62 0.014 264);

  /* ---- accent (references central indigo tokens) ---- */
  --ac:      var(--accent);
  --ac-hi:   var(--accent-hi);
  --ac-dim:  var(--accent-soft);
  --ac-line: var(--accent-line);
  --ac-ink:  var(--accent-ink);

  /* ---- semantics (keep hue, lower L for solid text on white, bump washes) ---- */
  --ok:      oklch(0.55 0.15 158);
  --ok-dim:  oklch(0.62 0.16 158 / 0.16);
  --ok-line: oklch(0.62 0.16 158 / 0.40);

  --warn:     oklch(0.58 0.14 78);
  --warn-dim: oklch(0.72 0.15 78 / 0.18);
  --warn-line:oklch(0.72 0.15 78 / 0.42);

  --bad:      oklch(0.55 0.20 22);
  --bad-dim:  oklch(0.62 0.20 22 / 0.12);
  --bad-line: oklch(0.62 0.20 22 / 0.42);

  /* ---- shadow (lighter black alpha for light surfaces) ---- */
  --sh-1: 0 1px 2px oklch(0 0 0 / 0.06);
  --sh-2: 0 8px 24px -12px oklch(0 0 0 / 0.18);
  --sh-3: 0 24px 60px -16px oklch(0 0 0 / 0.22);
}

/* literal (b): sticky topbar glass hardcodes the dark --bg-0 value — repoint
   to a light translucent surface so the blur reads on a light page */
[data-bs-theme="light"] .orgx .create-topbar {
  background: oklch(0.99 0 0 / 0.85);
}

/* literal (c): modal scrim (oklch(0.1 0.01 264 / 0.62)) is a black scrim —
   correct on light too, intentionally left as-is. */
