/* ═══════════════════════════════════════════════════════════════════════════
   Scope Editor (P0d) - admin UI for BU + Location hierarchy edges.
   Lives inside the admin console modal as a new section. Visual idiom
   matches the surrounding admin sections (data schema, user grants).
   ═══════════════════════════════════════════════════════════════════════════ */

.admin-section-help {
  font-size: 11px;
  color: var(--slate, #6B7280);
  line-height: 1.5;
  margin: -4px 0 12px;
}

/* ── Tab strip ─────────────────────────────────────────────────────────── */
.admin-scope-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--smoke, #E5E7EB);
  margin-bottom: 12px;
}
.admin-scope-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate, #6B7280);
  cursor: pointer;
  transition: all 0.12s ease;
}
.admin-scope-tab:hover {
  color: var(--black, #111827);
  background: rgba(0, 0, 0, 0.03);
}
.admin-scope-tab.active {
  color: var(--orange-bright, #FF5A00);
  border-bottom-color: var(--orange-bright, #FF5A00);
}

/* ── Pane (per-tab content) ─────────────────────────────────────────────── */
.admin-scope-pane.hidden { display: none; }

/* ── Add-edge row ──────────────────────────────────────────────────────── */
.admin-scope-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  background: #FFFBEB;
  border: 1px solid #FED7AA;
  border-radius: 8px;
  margin-bottom: 14px;
}
.admin-scope-add-row .dp-field {
  margin: 0;
}
.admin-scope-add-row .dp-field input {
  width: 100%;
  padding: 6px 8px;
  font-size: 11px;
}
@media (max-width: 720px) {
  .admin-scope-add-row {
    grid-template-columns: 1fr;
  }
}

/* ── Edge list ────────────────────────────────────────────────────────── */
.admin-scope-list {
  border: 1px solid var(--smoke, #E5E7EB);
  border-radius: 8px;
  background: #FFFFFF;
  overflow: hidden;
}
.admin-scope-rows > .admin-scope-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #F3F4F6;
  font-size: 12px;
}
.admin-scope-rows > .admin-scope-row:last-child {
  border-bottom: 0;
}
.admin-scope-rows > .admin-scope-row:hover {
  background: #F9FAFB;
}
.admin-scope-row-edge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--black, #111827);
}
.admin-scope-parent {
  color: var(--orange-bright, #FF5A00);
}
.admin-scope-arrow {
  color: var(--mist, #9CA3AF);
  font-size: 11px;
}
.admin-scope-child {
  color: var(--black, #111827);
}
.admin-scope-row-meta {
  font-size: 10px;
  color: var(--mist, #9CA3AF);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
/* Item 6: effective_from/to label for hierarchy edges. Visually weaker
   than the regular created-at date - most edges don't have it, and when
   they do it's secondary metadata. */
.admin-scope-effective {
  font-size: 9.5px;
  color: var(--slate, #6B7280);
  font-style: italic;
  font-weight: 500;
}

/* Filter input above the edge list. Inline with the "showing N of M"
   counter so an admin can search a 300-edge list without scrolling. */
.admin-scope-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--mist, #E5E7EB);
}
.admin-scope-filter-input {
  flex: 1;
  font-size: 11.5px;
  padding: 5px 9px;
  border: 1px solid var(--mist, #D1D5DB);
  border-radius: 4px;
  background: #FFFFFF;
  color: var(--black, #111827);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}
.admin-scope-filter-input:focus {
  outline: 1px solid var(--yellow, #FFB300);
  border-color: var(--yellow, #FFB300);
}
.admin-scope-filter-counter {
  font-size: 10px;
  color: var(--slate, #6B7280);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.admin-scope-row-delete {
  font-size: 10.5px;
  padding: 4px 10px;
}

/* ── Empty / error states ───────────────────────────────────────────────── */
.admin-scope-empty,
.admin-scope-loading {
  padding: 20px 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--slate, #6B7280);
  font-style: italic;
}
.admin-scope-error {
  color: #B91C1C;
  background: #FEF2F2;
}

/* ── Workflow RACI tab (P2) ────────────────────────────────────────────── */
.admin-scope-add-row-raci {
  grid-template-columns: 1fr 1.1fr 1.1fr 1.4fr auto;
}
@media (max-width: 720px) {
  .admin-scope-add-row-raci {
    grid-template-columns: 1fr;
  }
}
.admin-scope-add-row .dp-field select {
  width: 100%;
  padding: 6px 8px;
  font-size: 11px;
  background: #FFFFFF;
  border: 1px solid var(--smoke, #E5E7EB);
  border-radius: 6px;
}

/* RACI pill: orange R/A (gating), grey C/I (advisory) */
.admin-scope-row-raci {
  grid-template-columns: 1fr auto 1fr auto auto auto;
  align-items: center;
}
.admin-raci-kind {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0;
}
.admin-raci-kind-r,
.admin-raci-kind-a {
  background: var(--orange-bright, #FF5A00);
  color: #FFFFFF;
}
.admin-raci-kind-c,
.admin-raci-kind-i {
  background: #E5E7EB;
  color: #4B5563;
}
.admin-raci-finance {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 4px;
  background: #ECFDF5;
  color: #059669;
  font-weight: 800;
  font-size: 11px;
}

/* ── Auto-detect row (P3) ──────────────────────────────────────────────── */
.admin-scope-detect-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #F0F9FF;
  border: 1px dashed #BAE6FD;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 11px;
}
.admin-scope-detect-help {
  flex: 1;
  color: var(--slate, #6B7280);
  line-height: 1.4;
}
.admin-scope-detect-sep {
  flex: 0 0 auto;
  margin: 0;
}
.admin-scope-detect-sep input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 4px 8px;
  width: 60px;
  text-align: center;
}
