/* BioStudio Organization Platform */

:root {
  /* Entity colors */
  --org-color-organization: #6366f1;
  --org-color-department: #0ea5e9;
  --org-color-team: #14b8a6;
  --org-color-project: #f59e0b;
  --org-color-subproject: #a855f7;
  --org-color-person: #64748b;

  /* Status semantics */
  --org-status-active: #10b981;
  --org-status-warn: #f59e0b;
  --org-status-danger: #ef4444;
  --org-status-neutral: #94a3b8;
  --org-status-draft: #8b5cf6;

  /* Surfaces */
  --org-surface: rgba(255, 255, 255, 0.55);
  --org-surface-elevated: #fff;
  --org-border: rgba(0, 0, 0, 0.08);
  --org-border-strong: rgba(0, 0, 0, 0.12);

  /* Shadows */
  --org-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --org-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --org-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Spacing */
  --org-space-xs: 4px;
  --org-space-sm: 8px;
  --org-space-md: 12px;
  --org-space-lg: 16px;
  --org-space-xl: 24px;

  /* Motion */
  --org-transition-fast: 0.12s ease;
  --org-transition: 0.2s ease;

  /* Z-index */
  --org-z-nav: 10;
  --org-z-drawer: 900;
  --org-z-modal: 1000;
  --org-z-toast: 1100;

  /* Nav accent */
  --org-nav-active: rgba(99, 102, 241, 0.14);
  --org-nav-active-border: #6366f1;
}

.org-platform-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  font-size: 13px;
  position: relative; /* anchor for the floating AI assistant */
}

.org-platform-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.org-platform-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-bottom: 2px;
}

.org-platform-header h1 {
  margin: 0;
  font-size: 20px;
}

.org-platform-status {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  max-width: 320px;
  text-align: right;
}

.org-platform-status-warn { color: #b45309; }
.org-platform-status-error { color: #dc2626; }

.org-platform-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.org-platform-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 200px;
  min-width: 200px;
  padding: 10px 8px;
  border-right: 1px solid var(--org-border);
  overflow: auto;
  transition: width var(--org-transition), min-width var(--org-transition);
  position: relative;
  z-index: var(--org-z-nav);
}

.org-platform-nav.collapsed {
  width: 52px;
  min-width: 52px;
}

.org-nav-collapse-btn {
  align-self: flex-end;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
  opacity: 0.6;
}
.org-nav-collapse-btn:hover { opacity: 1; background: rgba(0,0,0,0.04); }

.org-nav-search-wrap { margin-bottom: 8px; }
.org-platform-nav.collapsed .org-nav-search-wrap,
.org-platform-nav.collapsed .org-nav-group-label,
.org-platform-nav.collapsed .org-nav-tab-label,
.org-platform-nav.collapsed .org-nav-tab-badge { display: none; }

.org-nav-group { margin-bottom: 8px; }
.org-nav-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.5;
  padding: 4px 10px 6px;
  font-weight: 600;
}

.org-platform-tab {
  border: none;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;
  transition: background var(--org-transition-fast);
}

.org-nav-tab-icon { flex-shrink: 0; width: 18px; text-align: center; }
.org-nav-tab-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.org-platform-tab:hover { background: rgba(0, 0, 0, 0.04); }
.org-platform-tab.active {
  background: var(--org-nav-active);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--org-nav-active-border);
}

.org-platform-tab.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.org-nav-tab-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--org-status-danger);
  color: #fff;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

.org-platform-content {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
}

.org-platform-hero h2 { margin: 0 0 6px; font-size: 18px; }
.org-platform-hero p { margin: 0 0 12px; opacity: 0.75; line-height: 1.5; }
.org-platform-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
}
.org-platform-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.45);
}
.org-platform-actions { display: flex; gap: 8px; margin-top: 12px; }

.org-projects-module { display: flex; flex-direction: column; gap: 12px; }
.org-projects-toolbar, .org-detail-header, .org-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.org-projects-toolbar-left h2, .org-detail-title-row h2 { margin: 0; font-size: 18px; }
.org-projects-filters, .org-form-row, .org-detail-actions, .org-modal-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.org-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.org-project-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
}
.org-project-card:hover { border-color: rgba(62, 207, 142, 0.45); }
.org-project-card-top { display: flex; gap: 6px; margin-bottom: 8px; }
.org-project-status, .org-project-priority, .org-badge, .org-health {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}
.org-project-desc { font-size: 12px; opacity: 0.8; margin: 0 0 8px; }
.org-project-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; }
.org-meta-chip { display: flex; flex-direction: column; gap: 1px; }
.org-detail-tabs, .org-workflow-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.org-detail-tab {
  border: none; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 12px;
}
.org-detail-tab.active { background: rgba(62, 207, 142, 0.15); font-weight: 600; }
.org-panel { padding: 4px 0 12px; }
.org-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.org-overview-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.5);
}
.org-overview-card.org-span-2 { grid-column: span 2; }
.org-overview-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 12px; }
.org-overview-row-clickable {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background var(--org-transition-fast);
}
.org-overview-row-clickable:hover,
.org-overview-row-clickable:focus-visible {
  background: rgba(42, 120, 214, 0.06);
  outline: none;
}
.org-overview-row-clickable:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(42, 120, 214, 0.35);
}
.org-input, .org-textarea, .org-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}
.org-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 140px; flex: 1; }
.org-field-label { font-size: 11px; text-transform: uppercase; opacity: 0.65; }
.org-check { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.org-team-subgroup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-team-subgroup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--org-border);
  border-radius: 8px;
}
.org-team-subgroup-row > span:first-child { flex: 1; font-weight: 500; }
.org-team-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; margin-bottom: 8px; }
.org-team-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--org-border);
  border-radius: 8px;
  cursor: pointer;
}
.org-team-pick-row:hover { background: rgba(0, 0, 0, 0.03); }
.org-team-pick-row input[type="checkbox"] { accent-color: #2563eb; }
.org-empty, .org-coming-soon { opacity: 0.7; font-size: 12px; padding: 16px 0; }
.org-table-empty-cell { text-align: center; padding: 24px 12px !important; }
.org-table-empty-cell .org-empty { padding: 8px 0; }
.org-table-wrap { overflow: auto; }
.org-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.org-table th, .org-table td { padding: 8px 10px; border-bottom: 1px solid rgba(0, 0, 0, 0.06); text-align: left; }
.org-project-row.inactive,
.org-task-row.inactive {
  color: #7a808a;
  background: rgba(148, 163, 184, 0.08);
}
.org-project-row.inactive .org-muted,
.org-task-row.inactive .org-muted { color: #8a9099; opacity: 1; }
.org-inactive-title { font-weight: 600; color: #6b7280; }
.org-subproject-chip.inactive {
  opacity: 0.58;
  filter: grayscale(1);
  cursor: default;
}
.org-assignee-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.org-assignee-chip {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(62, 207, 142, 0.12);
  font-size: 10px;
}

.org-team-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--org-space-lg);
  padding-bottom: var(--org-space-xl);
}
.org-team-page-header {
  display: flex;
  flex-direction: column;
  gap: var(--org-space-md);
}
.org-team-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-bottom: 2px;
}
.org-team-page-intro h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}
.org-team-page-intro p {
  margin: 0;
  opacity: 0.75;
  line-height: 1.5;
  max-width: 640px;
}
.org-team-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.org-team-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.org-team-stats-inline { margin-top: 2px; }
.org-team-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--org-space-lg);
  align-items: start;
}
.org-team-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  border: 1px solid var(--org-border);
  border-radius: 14px;
  padding: 12px;
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-sm);
}
.org-team-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--org-border);
}
.org-team-sidebar-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.org-team-sidebar-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}
.org-team-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(70vh, 560px);
  overflow: auto;
}
.org-team-person {
  border: 1px solid var(--org-border);
  border-radius: 10px;
  background: var(--org-surface);
  padding: 10px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color var(--org-transition-fast), background var(--org-transition-fast), box-shadow var(--org-transition-fast);
}
.org-team-person:hover {
  border-color: var(--org-border-strong);
  background: #fff;
  box-shadow: var(--org-shadow-sm);
}
.org-team-person.active {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 3px 0 0 #6366f1;
}
.org-team-person-label strong,
.org-team-person-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-team-person-label small { color: #6b7280; font-size: 11px; }
.org-team-person-progress {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
}
.org-team-person-progress.has-blocked {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}
.org-team-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #1e40af;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.org-team-avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 16px;
}
.org-team-detail { min-width: 0; }
.org-team-detail-body {
  display: flex;
  flex-direction: column;
  gap: var(--org-space-md);
}
.org-team-person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--org-border);
  border-radius: 14px;
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-sm);
}
.org-team-person-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.org-team-person-info strong { font-size: 16px; }
.org-team-person-info .org-muted { font-size: 12px; }
.org-team-person-role {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #6366f1;
}
.org-team-person-meta {
  font-size: 11px;
  color: #6b7280;
}
.org-team-person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.org-team-manager-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.org-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--org-space-md);
}
.org-team-panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}
.org-team-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.org-team-panel-sub {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.7;
  line-height: 1.45;
}
.org-team-panel-span,
.org-team-panel.org-team-panel-span { grid-column: span 2; }
.org-team-project-list,
.org-team-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-team-project-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.org-team-project-row .org-team-project-card { flex: 1; min-width: 0; }
.org-team-project-row .btn { flex-shrink: 0; align-self: center; }
.org-team-project-assign {
  margin-bottom: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--org-border);
}
.org-team-project-card {
  border: 1px solid var(--org-border);
  border-radius: 10px;
  background: var(--org-surface);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color var(--org-transition-fast), box-shadow var(--org-transition-fast);
}
.org-team-project-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--org-shadow-sm);
}
.org-team-project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.org-team-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
  margin: 10px 0 8px;
}
.org-team-progress span {
  display: block;
  height: 100%;
  background: #6366f1;
  border-radius: 999px;
  transition: width var(--org-transition);
}
.org-team-progress[data-tone="ok"] span { background: #10b981; }
.org-team-progress[data-tone="warn"] span { background: #f59e0b; }
.org-team-project-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 11px;
  color: #6b7280;
}
.org-team-task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--org-border);
  border-radius: 10px;
  background: var(--org-surface);
}
.org-team-task-clickable {
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
  transition: border-color var(--org-transition-fast), box-shadow var(--org-transition-fast);
}
.org-team-task-clickable:hover,
.org-team-task-clickable:focus-visible {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--org-shadow-sm);
  outline: none;
}
.org-team-task-dialog-head {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.org-team-task-thread {
  margin-top: 4px;
  border-top: 1px solid var(--org-border);
  padding-top: 12px;
}
.org-team-task-body strong,
.org-team-task-body small {
  display: block;
}
.org-team-task-body small { margin-top: 2px; }
.org-team-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 2;
  isolation: isolate;
}
.org-team-composer input[type="date"] {
  position: relative;
  z-index: 1;
  min-height: 34px;
}
.org-team-composer input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 4px;
}
.org-team-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.org-team-timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 16px;
  position: relative;
}
.org-team-timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--org-border);
}
.org-team-timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 2px;
  background: #6366f1;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}
.org-team-timeline-content strong,
.org-team-timeline-content span {
  display: block;
}
.org-team-timeline-content strong { font-size: 13px; }
.org-team-timeline-content span { font-size: 11px; margin-top: 2px; }
.org-team-timeline-content p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #4b5563;
}

@media (max-width: 900px) {
  .org-team-layout,
  .org-team-grid { grid-template-columns: 1fr; }
  .org-team-panel-span { grid-column: auto; }
  .org-team-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-team-person-card {
    flex-wrap: wrap;
  }
  .org-team-person-actions {
    width: 100%;
    margin-left: 0;
  }
}
.org-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.org-modal { background: #fff; border-radius: 12px; width: min(480px, 92vw); max-height: 90vh; overflow: auto; padding: 0; box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22); }
.org-modal-wide { width: min(820px, 94vw); }
.org-modal-head, .org-modal-foot { padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.08); display: flex; justify-content: space-between; align-items: center; }
.org-modal-foot { border-bottom: none; border-top: 1px solid rgba(0,0,0,0.08); justify-content: flex-end; gap: 8px; }
.org-modal-body { padding: 14px 16px; }
.org-section { display: flex; flex-direction: column; gap: 12px; }
.org-badge-active { background: rgba(16,185,129,0.15); color: #047857; }
.org-badge-inactive { background: rgba(0,0,0,0.06); }

/* Manager Dashboard */
.mgr-dashboard { height: 100%; overflow: auto; }
.mgr-dashboard-inner { display: flex; flex-direction: column; gap: 18px; padding: 4px 2px 20px; }
.mgr-dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mgr-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.6; }
.mgr-dashboard-header h2 { margin: 4px 0; font-size: 20px; }
.mgr-dashboard-blurb { margin: 0; opacity: 0.75; max-width: 640px; line-height: 1.5; }
.mgr-header-actions { display: flex; gap: 8px; }
.mgr-scope-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mgr-scope-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.mgr-scope-field select { min-width: 140px; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.12); }
.mgr-section { display: flex; flex-direction: column; gap: 10px; }
.mgr-section-head h3 { margin: 0; font-size: 15px; }
.mgr-section-sub { margin: 4px 0 0; font-size: 12px; opacity: 0.7; }
.mgr-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.mgr-summary-card {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.5);
  text-align: center;
}
.mgr-summary-card--highlight { border-color: rgba(62,207,142,0.35); }
.mgr-summary-icon { font-size: 18px; margin-bottom: 4px; }
.mgr-summary-value { font-size: 18px; font-weight: 700; }
.mgr-summary-label { font-size: 10px; opacity: 0.7; margin-top: 4px; }
.mgr-table-wrap { overflow: auto; }
.mgr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mgr-table th, .mgr-table td { padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,0.06); text-align: left; }
.mgr-health-badge, .mgr-workload-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: color-mix(in srgb, var(--health-color, #94a3b8) 18%, transparent);
  color: var(--health-color, #64748b);
}
.mgr-insights-list, .mgr-actions-list, .mgr-deadlines-list, .mgr-notifications-list {
  margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.5;
}
.mgr-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.mgr-charts-row { display: flex; flex-wrap: wrap; gap: 12px; }
.mgr-chart-card { border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 12px; background: rgba(255,255,255,0.5); }
.mgr-dash-muted, .mgr-loading, .mgr-access-denied { opacity: 0.75; font-size: 13px; }
.mgr-privacy-note { font-size: 11px; opacity: 0.65; font-style: italic; margin-bottom: 8px; }
.mgr-footer-note { font-size: 11px; opacity: 0.6; margin-top: 16px; }
.mgr-notif-badge { margin-left: 6px; font-size: 10px; color: #d62828; font-weight: 600; }
.nc-org-list { display: flex; flex-direction: column; gap: 10px; }
.nc-org-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 12px;
}
.nc-org-item small { opacity: 0.65; }

.ai-brief-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  margin-top: 10px;
}

.ai-brief-card--empty {
  opacity: 0.75;
}

.ai-brief-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-brief-card-head h4 {
  margin: 0;
  font-size: 15px;
}

.ai-brief-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 11px;
  opacity: 0.7;
}

.ai-brief-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.ai-brief-tag--fallback {
  background: rgba(234, 179, 8, 0.15);
  color: #a16207;
}

.ai-brief-summary {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 10px;
}

.ai-brief-sections h5 {
  margin: 10px 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.ai-brief-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}

.ai-brief-list--risks li {
  color: #c2410c;
}

.ai-brief-muted {
  font-size: 12px;
  opacity: 0.65;
  margin: 0;
}

.ai-brief-generator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.ai-brief-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.ai-brief-select {
  min-width: 160px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.ai-brief-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ai-brief-source-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
}

.ai-brief-actions {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}

.ai-health-badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--health-color) 18%, transparent);
  color: var(--health-color);
  text-transform: capitalize;
  margin: 2px;
}

.ai-health-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}

.ai-project-health-card,
.my-work-summary-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.5);
}

.my-work-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mgr-workflow-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.mgr-workflow-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  text-align: center;
}

.mgr-workflow-widget strong {
  font-size: 20px;
}

.mgr-workflow-overall {
  grid-column: 1 / -1;
  font-size: 13px;
  margin-bottom: 4px;
}

/* --- Lineage, decisions, entity drawer (enterprise workflow) ------------ */

.lineage-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lineage-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lineage-trace-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lineage-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 8px;
}

.lineage-chain {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 480px;
  overflow: auto;
  padding: 8px 0;
}

.lineage-chain-node {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.5);
}

.lineage-chain-node.lineage-badge-raw { border-left: 3px solid #3b82f6; }
.lineage-chain-node.lineage-badge-final { border-left: 3px solid #10b981; }

.lineage-chain-meta {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

.lineage-rel-chip,
.lineage-status-chip {
  display: inline-block;
  margin-top: 4px;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.06);
}

.lineage-highlight {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  margin-bottom: 8px;
  font-size: 12px;
}

.lineage-warn {
  color: #b45309;
  font-size: 12px;
  margin: 0 0 8px;
}

.decision-log-panel { display: flex; flex-direction: column; gap: 12px; }
.decision-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.decision-list { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow: auto; }
.decision-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.decision-card-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.decision-type-chip,
.decision-pending-chip,
.decision-approved-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}
.decision-pending-chip { background: rgba(244, 162, 89, 0.2); color: #b45309; }
.decision-approved-chip { background: rgba(16, 185, 129, 0.15); color: #047857; }
.decision-field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.65;
}
.decision-field p { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.decision-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; opacity: 0.75; margin-top: 8px; }
.decision-card-actions { display: flex; gap: 6px; margin-top: 8px; }

.entity-drawer-overlay { justify-content: flex-end; align-items: stretch; }
.entity-drawer {
  width: min(520px, 96vw);
  max-height: 100vh;
  overflow: auto;
  margin: 0;
  border-radius: 14px 0 0 14px;
}
.entity-drawer-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.entity-drawer-tab {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.entity-drawer-tab.active { background: rgba(62, 207, 142, 0.15); font-weight: 600; }
.entity-drawer-dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.entity-drawer-dl dt { opacity: 0.65; font-size: 11px; text-transform: uppercase; }
.entity-drawer-dl dd { margin: 0; }

.org-entity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.org-entity-row-main { flex: 1; cursor: pointer; }
.org-entity-row-actions { display: flex; gap: 4px; }

.org-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.org-workflow-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 14px;
}
.org-workflow-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* Pipeline tracker */
.pipeline-tracker { padding: 4px 0; }
.pipeline-progress-bar {
  position: relative;
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  margin: 8px 0 16px;
  overflow: hidden;
}
.pipeline-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f6bff, #19c39c);
  border-radius: 4px;
  transition: width 0.3s;
}
.pipeline-progress-label {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 11px;
  opacity: 0.7;
}
.pipeline-stage-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pipeline-stage-card {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  border-left: 4px solid #2f6bff;
}
.pipeline-stage-card[data-status="blocked"] { border-left-color: #d62828; }
.pipeline-stage-card[data-status="completed"] { border-left-color: #19c39c; opacity: 0.85; }
.pipeline-stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pipeline-stage-order {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(47,107,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.pipeline-blocked-reason { color: #d62828; font-size: 13px; margin: 6px 0; }
.pipeline-bottleneck { color: #b45309; font-size: 13px; padding: 8px 12px; background: rgba(244,162,89,0.12); border-radius: 8px; }
.pipeline-stage-actions { margin-top: 8px; }
.org-badge-warn { background: rgba(214,40,40,0.12); color: #d62828; }
.org-badge-info { background: rgba(47,107,255,0.12); color: #2f6bff; }
.org-badge-ok { background: rgba(25,195,156,0.12); color: #19c39c; }
.org-badge-active { background: rgba(47,107,255,0.12); color: #2f6bff; }
.org-badge-muted { background: rgba(0,0,0,0.06); opacity: 0.8; }

/* Work requests */
.work-requests-module { padding: 4px 0; }
.work-request-views { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.work-request-detail { padding: 12px 0; }
.work-request-badges { display: flex; gap: 8px; margin: 8px 0; }
.work-request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.work-request-history { font-size: 13px; padding-left: 20px; }

/* Capacity planner */
.capacity-planner { padding: 4px 0; }
.capacity-planner-header { margin-bottom: 16px; }
.capacity-scope-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 12px; }
.capacity-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.capacity-summary-card {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.capacity-summary-card strong { display: block; font-size: 22px; margin: 4px 0; }
.capacity-summary-card span { font-size: 11px; opacity: 0.75; }
.capacity-actions { font-size: 13px; padding-left: 20px; line-height: 1.6; }
.org-pipeline-presets { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn.sm { font-size: 11px; padding: 4px 8px; }
.btn.link { background: none; border: none; color: #2f6bff; cursor: pointer; text-align: left; padding: 0; }

.org-wf-review-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 16px;
  min-height: 280px;
}
.org-wf-review-sidebar { border-right: 1px solid rgba(0, 0, 0, 0.08); padding-right: 12px; }
.org-wf-review-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 8px; background: transparent; cursor: pointer;
}
.org-wf-review-item.active { background: rgba(62, 207, 142, 0.12); border-color: rgba(62, 207, 142, 0.35); }
.org-wf-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: rgba(0,0,0,0.06); }
.org-wf-kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.org-wf-kv { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.org-wf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.org-wf-mention { color: #0a7; font-weight: 600; }
.org-wf-manifest { max-height: 200px; overflow: auto; font-size: 11px; padding: 10px; border-radius: 8px; background: rgba(0,0,0,0.04); }
.entity-drawer { width: min(720px, 94vw); max-height: 88vh; overflow: auto; }
.entity-drawer-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.entity-drawer-tab { padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1); background: transparent; cursor: pointer; font-size: 12px; }
.entity-drawer-tab.active { background: rgba(62, 207, 142, 0.15); }

/* QC Gate + Template Library */
.org-ready { display: inline-block; font-size: 11px; color: #0a7; font-weight: 600; margin: 6px 0; }
.qc-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.1);
}
.qc-status-badge.qc-status-compact { width: 10px; height: 10px; padding: 0; border-radius: 50%; text-indent: -9999px; overflow: hidden; }
.qc-status-ok { background: #e6f9ef; color: #0a7; border-color: #b8efd4; }
.qc-status-warn { background: #fff8e6; color: #b86e00; border-color: #ffe08a; }
.qc-status-fail { background: #ffecec; color: #c00; border-color: #ffb8b8; }
.qc-status-muted { background: #f3f4f6; color: #666; }
.qc-gate-panel { display: flex; flex-direction: column; gap: 12px; }
.qc-gate-header { display: flex; align-items: center; gap: 10px; }
.qc-gate-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; opacity: 0.8; }
.qc-gate-alert { background: #fff3cd; border: 1px solid #ffc107; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.qc-finding { border: 1px solid rgba(0,0,0,0.08); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.qc-finding-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.qc-sev { font-size: 10px; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; }
.qc-sev-critical { background: #ffecec; color: #c00; }
.qc-sev-warning { background: #fff8e6; color: #b86e00; }
.qc-sev-info { background: #eef4ff; color: #245; }
.qc-suggested { font-size: 12px; font-style: italic; opacity: 0.85; }
.qc-waive-form { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.qc-waive-form input { flex: 1; min-width: 180px; }
.template-library-header { margin-bottom: 12px; }
.template-library-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.template-library-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.template-card { border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 12px; }
.template-card-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.template-type { font-size: 11px; text-transform: capitalize; opacity: 0.7; }
.template-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; margin: 8px 0; }
.template-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-create-form { border: 1px dashed rgba(0,0,0,0.15); padding: 12px; border-radius: 8px; margin-bottom: 12px; display: grid; gap: 8px; }
.tpl-public { color: #0a7; }
.tpl-private { color: #666; }
.entity-drawer-dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; }

/* Org Chart / Hierarchy */
.org-chart-viewport {
  overflow: auto;
  padding: 16px 8px 24px;
  min-height: 320px;
}

.org-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 11px;
}

.org-chart-legend-title {
  font-weight: 600;
  opacity: 0.7;
}

.org-chart-legend-item {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
}

.org-chart {
  display: flex;
  flex-direction: column;
  padding: 8px 0 24px;
  width: 100%;
}

.org-chart-scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  padding-bottom: 8px;
}

.org-chart-root {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: min-content;
}

.org-chart-branch-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.org-chart-collapse-btn {
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 12px;
}

.org-chart-collapse-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.org-chart-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.org-chart-add-btn {
  border: 1px dashed rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--org-color-department, #0ea5e9);
}

.org-chart-add-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: var(--org-color-department, #0ea5e9);
}

.org-chart-add-panel {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12px;
}

.org-chart-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.org-chart-add-row .org-input {
  flex: 1;
  min-width: 140px;
}

.org-chart-vertical .org-chart-level {
  flex-direction: column;
  align-items: flex-start;
  padding-left: 20px;
  padding-top: 12px;
}

.org-chart-vertical .org-chart-level::before {
  left: 0;
  transform: none;
}

.org-chart-vertical .org-chart-branch {
  align-items: flex-start;
  padding: 4px 0;
}

.org-detail-tabs {
  display: flex;
  gap: 4px;
  margin: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0;
}

.org-detail-tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: rgba(0, 0, 0, 0.55);
}

.org-detail-tab:hover {
  color: rgba(0, 0, 0, 0.85);
}

.org-detail-tab.active {
  color: var(--org-color-department, #0ea5e9);
  border-bottom-color: var(--org-color-department, #0ea5e9);
  font-weight: 600;
}

.org-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 8px;
}

.org-breadcrumb-link {
  padding: 0;
  font-size: 12px;
}

.org-breadcrumb-sep {
  opacity: 0.4;
}

.org-breadcrumb-current {
  font-weight: 600;
}

.org-detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.org-detail-title-row h3 {
  margin: 0;
}

.org-body-modal-host {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.org-chart-mini-panel {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  overflow: auto;
  max-height: 480px;
}

.org-chart-level {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
  position: relative;
  min-width: min-content;
}

.org-chart-level::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 24px;
  background: rgba(0, 0, 0, 0.15);
  transform: translateX(-50%);
}

.org-chart-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 0 12px;
  margin-top: 0;
}

.org-chart-branch.has-children::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  width: 2px;
  height: 24px;
  background: rgba(0, 0, 0, 0.15);
}

.org-chart-branch.has-children > .org-chart-level::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 0, 0, 0.12);
}

.org-chart-card {
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 160px;
  max-width: 220px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
}

.org-chart-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.org-chart-card-organization { border-color: #6366f1; background: linear-gradient(135deg, #eef2ff, #fff); }
.org-chart-card-department { border-color: #0ea5e9; background: linear-gradient(135deg, #f0f9ff, #fff); }
.org-chart-card-team { border-color: #22c55e; background: linear-gradient(135deg, #f0fdf4, #fff); }
.org-chart-card-project { border-color: #f59e0b; background: linear-gradient(135deg, #fffbeb, #fff); }
.org-chart-card-subproject { border-color: #a855f7; background: linear-gradient(135deg, #faf5ff, #fff); min-width: 130px; }
.org-chart-card-person { border-color: #94a3b8; background: linear-gradient(135deg, #f8fafc, #fff); min-width: 130px; max-width: 180px; padding: 8px 12px; }

.org-chart-card-compact {
  min-width: 120px;
  max-width: 180px;
  padding: 8px 10px;
  font-size: 12px;
}

.org-chart-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.org-chart-card-icon { font-size: 18px; line-height: 1; }
.org-chart-card-compact .org-chart-card-icon { font-size: 14px; }

.org-chart-card-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.org-chart-card-name {
  font-size: 13px;
  line-height: 1.3;
  word-break: break-word;
}

.org-chart-card-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.org-chart-leads {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.org-chart-lead {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.org-chart-lead-role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  opacity: 0.8;
}

.org-chart-lead-name { font-weight: 600; }

.org-chart-lead-admin { background: #ede9fe; color: #5b21b6; }
.org-chart-lead-dept { background: #e0f2fe; color: #0369a1; }
.org-chart-lead-team { background: #dcfce7; color: #15803d; }
.org-chart-lead-project { background: #fef3c7; color: #b45309; }
.org-chart-lead-default { background: rgba(0, 0, 0, 0.05); }

.org-chart-person-role {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.65;
  text-transform: capitalize;
}

.org-chart-compact .org-chart-level { padding-top: 16px; }
.org-chart-compact .org-chart-level::before { height: 16px; }
.org-chart-compact .org-chart-branch.has-children::before { height: 16px; top: -16px; }

.org-chart-mini-panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

/* View switcher (table / chart) */
.org-view-switcher {
  display: inline-flex;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.org-view-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.org-view-btn:hover { background: rgba(0, 0, 0, 0.04); }
.org-view-btn.active {
  background: rgba(62, 207, 142, 0.18);
  font-weight: 600;
}

/* Drag and drop */
.org-dnd-draggable { cursor: grab; }
.org-dnd-draggable:active { cursor: grabbing; }
.org-dnd-dragging { opacity: 0.45; transform: scale(0.98); }
.org-dnd-dropt {
  outline: 2px dashed #22c55e !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15) !important;
}

.org-chart-hint {
  text-align: center;
  font-size: 12px;
  margin: 0 0 12px;
}

.org-chart-type-organization { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.org-chart-type-department { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.org-chart-type-team { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.org-chart-type-project { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.org-chart-type-subproject { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.org-chart-type-person { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* Projects table subprojects */
.org-subproject-expand-row td {
  background: rgba(0, 0, 0, 0.02);
  padding: 0 !important;
}

.org-subproject-nested {
  padding: 10px 16px 12px 36px;
  border-left: 3px solid #a855f7;
}

.org-subproject-nested-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.org-subproject-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.org-subproject-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  cursor: pointer;
}

.org-subproject-chip:hover { background: #ede9fe; }

.org-subproject-add-inline {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px dashed rgba(168, 85, 247, 0.35);
}

.org-subproject-add-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.org-subproject-chart-add-panel {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.org-projects-table .org-project-row:hover { background: rgba(0, 0, 0, 0.02); }

/* Kanban board */
.org-kanban-wrap { overflow: auto; padding: 8px 0 16px; }
.org-kanban-board {
  display: flex;
  gap: 12px;
  min-height: 320px;
  align-items: flex-start;
}
.org-kanban-column {
  flex: 0 0 200px;
  min-width: 180px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.org-kanban-column-head {
  padding: 10px 12px;
  border-bottom: 3px solid #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.org-kanban-count {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.org-kanban-column-body {
  padding: 8px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-kanban-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.org-kanban-card[data-priority="urgent"] { border-left: 3px solid #ef4444; }
.org-kanban-card[data-priority="high"] { border-left: 3px solid #f59e0b; }
.org-kanban-card[data-priority="normal"] { border-left: 3px solid #0ea5e9; }
.org-kanban-card[data-priority="low"] { border-left: 3px solid #94a3b8; }

/* Pipeline flow chart */
.org-pipeline-flow-wrap { padding: 8px 0; }
.org-pipeline-flow-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
}
.org-pipeline-flow-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.org-pipeline-flow-stages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.org-pipeline-flow-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--stage-color) 12%, white);
  border: 2px solid var(--stage-color);
  font-size: 12px;
}
.org-pipeline-stage-num {
  font-weight: 700;
  color: var(--stage-color);
  font-size: 11px;
}
.org-pipeline-flow-arrow {
  margin: 0 4px;
  opacity: 0.4;
  font-size: 14px;
}

/* Capacity chart */
.org-capacity-chart { padding: 8px 0; }
.org-capacity-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}
.org-capacity-bar-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.org-capacity-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s;
}

.org-hierarchy-row { cursor: pointer; }
.org-hierarchy-row:hover { background: rgba(0, 0, 0, 0.03); }
.org-hierarchy-row[data-node-type="department"] td:first-child { border-left: 3px solid #0ea5e9; }
.org-hierarchy-row[data-node-type="team"] td:first-child { border-left: 3px solid #22c55e; }
.org-hierarchy-row[data-node-type="project"] td:first-child { border-left: 3px solid #f59e0b; }
.org-hierarchy-row[data-node-type="subproject"] td:first-child { border-left: 3px solid #a855f7; }
.org-hierarchy-row[data-node-type="person"] td:first-child { border-left: 3px solid var(--org-color-person); }

.org-org-table-view { display: flex; flex-direction: column; gap: 12px; }
.org-hierarchy-sections { display: flex; flex-direction: column; gap: 10px; }
.org-hierarchy-section {
  border: 1px solid var(--org-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--org-surface);
}
.org-hierarchy-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: var(--org-surface-elevated);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.org-hierarchy-section-head:hover { background: rgba(0, 0, 0, 0.03); }
.org-hierarchy-section-chevron { color: var(--org-text-muted); font-size: 11px; width: 12px; }
.org-hierarchy-section-name { flex: 1; }
.org-hierarchy-section-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--org-text-muted);
}
.org-hierarchy-section-body .org-table-wrap { border: none; border-radius: 0; }
.org-hierarchy-section-body .org-hierarchy-table thead th {
  background: rgba(0, 0, 0, 0.02);
  font-size: 11px;
}

.org-detail-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.org-detail-split .org-detail-panel h4 { margin: 0 0 10px; font-size: 13px; }

/* ── Enterprise design system components ─────────────────────────────── */

.org-badge-neutral { background: rgba(148, 163, 184, 0.15); color: #475569; }
.org-badge-draft { background: rgba(139, 92, 246, 0.15); color: #6d28d9; }
.org-badge-warn { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.org-badge-danger { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.org-badge-role-admin { background: rgba(99, 102, 241, 0.15); color: #4338ca; }
.org-badge-role-dept { background: rgba(14, 165, 233, 0.15); color: #0369a1; }
.org-badge-role-team { background: rgba(20, 184, 166, 0.15); color: #0f766e; }
.org-badge-role-contrib { background: rgba(100, 116, 139, 0.12); color: #334155; }

.org-entity-badge.org-entity-org { background: color-mix(in srgb, var(--org-color-organization) 14%, white); color: var(--org-color-organization); }
.org-entity-badge.org-entity-dept { background: color-mix(in srgb, var(--org-color-department) 14%, white); color: #0369a1; }
.org-entity-badge.org-entity-team { background: color-mix(in srgb, var(--org-color-team) 14%, white); color: #0f766e; }
.org-entity-badge.org-entity-project { background: color-mix(in srgb, var(--org-color-project) 14%, white); color: #b45309; }
.org-entity-badge.org-entity-subproject { background: color-mix(in srgb, var(--org-color-subproject) 14%, white); color: #7e22ce; }
.org-entity-badge.org-entity-person { background: color-mix(in srgb, var(--org-color-person) 14%, white); color: #475569; }

.org-health-ok { background: rgba(16, 185, 129, 0.15); color: #047857; }
.org-health-warn { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.org-health-critical { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.org-health-neutral { background: rgba(0, 0, 0, 0.06); color: #64748b; }

.org-skeleton-wrap { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.org-skeleton-row { display: flex; flex-direction: column; gap: 6px; }
.org-skeleton {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: org-shimmer 1.2s infinite;
}
.org-skeleton-title { height: 16px; width: 40%; }
.org-skeleton-line { width: 90%; }
.org-skeleton-line.short { width: 55%; }
@keyframes org-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.org-info-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--org-radius-md, 8px);
  background: color-mix(in srgb, var(--org-color-department, #3b82f6) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--org-color-department, #3b82f6) 25%, transparent);
  color: var(--org-text-primary, #1e293b);
  font-size: 12px;
}

.org-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  font-size: 12px;
  margin-bottom: 12px;
}

.org-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: var(--org-z-drawer);
  display: flex;
  justify-content: flex-end;
}
.org-drawer {
  width: min(420px, 92vw);
  height: 100%;
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-lg);
  display: flex;
  flex-direction: column;
  animation: org-slide-in 0.2s ease;
}
@keyframes org-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.org-drawer-head, .org-drawer-foot {
  padding: 14px 16px;
  border-bottom: 1px solid var(--org-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.org-drawer-foot { border-bottom: none; border-top: 1px solid var(--org-border); justify-content: flex-end; gap: 8px; }
.org-drawer-body { flex: 1; overflow: auto; padding: 14px 16px; }
.org-drawer-head h3 { margin: 0; font-size: 16px; }

.org-toast-host {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: var(--org-z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.org-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  box-shadow: var(--org-shadow-md);
  max-width: 320px;
  animation: org-toast-in 0.2s ease;
}
.org-toast-info { border-left: 3px solid #38bdf8; }
.org-toast-success { border-left: 3px solid #34d399; }
.org-toast-warn { border-left: 3px solid #fbbf24; }
.org-toast-error { border-left: 3px solid #f87171; }
.org-toast strong { display: block; margin-bottom: 2px; }
.org-toast-close { border: none; background: transparent; color: inherit; cursor: pointer; opacity: 0.7; margin-left: auto; }
@keyframes org-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.org-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.org-metric-card {
  border: 1px solid var(--org-border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--org-surface);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: border-color var(--org-transition-fast), box-shadow var(--org-transition-fast);
}
.org-metric-card:hover { border-color: var(--org-border-strong); box-shadow: var(--org-shadow-sm); }
.org-metric-icon { font-size: 20px; line-height: 1; }
.org-metric-label { font-size: 11px; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.04em; }
.org-metric-value { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.org-metric-sub { font-size: 11px; opacity: 0.7; }
.org-metric-trend { font-size: 11px; margin-top: 4px; }
.org-metric-trend.up { color: var(--org-status-active); }
.org-metric-trend.down { color: var(--org-status-danger); }
.org-metric-organization { border-top: 3px solid var(--org-color-organization); }
.org-metric-department { border-top: 3px solid var(--org-color-department); }
.org-metric-team { border-top: 3px solid var(--org-color-team); }
.org-metric-project { border-top: 3px solid var(--org-color-project); }
.org-metric-warn { border-top: 3px solid var(--org-status-warn); }
.org-metric-danger { border-top: 3px solid var(--org-status-danger); }

.org-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.org-search-wrap { position: relative; flex: 1; min-width: 160px; max-width: 280px; }
.org-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.5;
  pointer-events: none;
}
.org-search-wrap .org-search { padding-left: 30px; }

.org-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.org-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
}
.org-chip-remove { border: none; background: transparent; cursor: pointer; opacity: 0.6; font-size: 14px; line-height: 1; }

.org-avatar-stack { display: flex; align-items: center; }
.org-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--org-color-organization);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  margin-left: -6px;
}
.org-avatar:first-child { margin-left: 0; }
.org-avatar-more { background: #64748b; font-size: 10px; }

.org-progress { margin: 6px 0; }
.org-progress-label { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.org-progress-track { height: 8px; background: rgba(0,0,0,0.06); border-radius: 999px; overflow: hidden; }
.org-progress-fill { height: 100%; background: var(--org-color-team); border-radius: 999px; transition: width var(--org-transition); }

.org-table-sticky thead { position: sticky; top: 0; z-index: 2; background: #fff; }
.org-table-compact th, .org-table-compact td { padding: 5px 8px; }
.org-table-row-clickable { cursor: pointer; }
.org-table-row-clickable:hover { background: rgba(99, 102, 241, 0.04); }
.org-th-sortable { cursor: pointer; }
.org-th-sortable:hover { background: rgba(0,0,0,0.03); }
.org-th-sortable.sorted { color: var(--org-color-organization); }

.org-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 800px) {
  .org-command-grid { grid-template-columns: 1fr; }
}
.org-command-panel {
  border: 1px solid var(--org-border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--org-surface-elevated);
}
button.org-command-panel {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
}
.org-command-panel h3 { margin: 0 0 10px; font-size: 14px; }
.org-command-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.org-command-panel-head h3 { margin: 0; }
.org-command-panel-clickable {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color var(--org-transition-fast), box-shadow var(--org-transition-fast);
}
.org-command-panel-clickable:hover,
.org-command-panel-clickable:focus-visible {
  border-color: var(--org-border-strong);
  box-shadow: var(--org-shadow-md);
  outline: none;
}
.org-progress-clickable {
  width: 100%;
  margin: 0 0 8px;
  padding: 4px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background var(--org-transition-fast);
}
.org-progress-clickable:hover,
.org-progress-clickable:focus-visible {
  background: rgba(42, 120, 214, 0.06);
  outline: none;
}
.org-risk-list { display: flex; flex-direction: column; gap: 8px; }
.org-risk-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
button.org-risk-item {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
}
.org-risk-item.critical { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); }
.org-risk-item-clickable {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background var(--org-transition-fast), border-color var(--org-transition-fast);
}
.org-risk-item-clickable:hover,
.org-risk-item-clickable:focus-visible {
  border-color: var(--org-border-strong);
  outline: none;
}

.org-access-matrix-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.org-access-tab {
  border: 1px solid var(--org-border);
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.org-access-tab.active { background: var(--org-nav-active); border-color: var(--org-nav-active-border); font-weight: 600; }

.org-health-warnings { margin: 8px 0 12px; }

/* ═══ Modern viz + table layer ═══════════════════════════════════════ */

:root {
  --org-viz-ink: #0b0b0b;
  --org-viz-ink-2: #52514e;
  --org-viz-muted: #898781;
  --org-viz-grid: #e1e0d9;
  --org-viz-surface: #fff;
}

/* ── Tables: modern container, header, rows ── */
.org-table-wrap {
  border: 1px solid var(--org-border);
  border-radius: 12px;
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-sm);
  overflow: auto;
}
.org-table { font-size: 12.5px; }
.org-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--org-viz-ink-2);
  background: rgba(0, 0, 0, 0.025);
  border-bottom: 1px solid var(--org-border-strong);
  white-space: nowrap;
}
.org-table th, .org-table td { padding: 9px 12px; }
.org-table tbody tr { transition: background var(--org-transition-fast); }
.org-table tbody tr:hover { background: rgba(42, 120, 214, 0.045); }
.org-table tbody tr:last-child td { border-bottom: none; }
.org-td-num { text-align: right; font-variant-numeric: tabular-nums; }
.org-th-num { text-align: right !important; }
.org-table-sticky thead th { position: sticky; top: 0; z-index: 2; }
.org-th-sortable::after { content: ""; }
.org-th-sortable:hover { color: var(--org-viz-ink); }

/* ── Stat / KPI tiles ── */
.org-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}
.org-stat-tile {
  position: relative;
  border: 1px solid var(--org-border);
  border-radius: 14px;
  padding: 13px 15px 12px;
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-sm);
  transition: box-shadow var(--org-transition-fast), transform var(--org-transition-fast), border-color var(--org-transition-fast);
  overflow: hidden;
}
.org-stat-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stat-accent, #2a78d6);
  border-radius: 4px 0 0 4px;
}
.org-stat-tile:hover { box-shadow: var(--org-shadow-md); transform: translateY(-1px); border-color: var(--org-border-strong); }
.org-stat-tile-clickable { cursor: pointer; }
.org-stat-tile-clickable:focus-visible { outline: 2px solid var(--stat-accent, #2a78d6); outline-offset: 2px; }
.org-stat-tile-clickable::after {
  content: "↗";
  position: absolute;
  top: 11px;
  right: 12px;
  font-size: 11px;
  color: var(--org-viz-muted);
  opacity: 0.65;
}
.org-stat-tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.org-stat-tile-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--org-viz-ink-2);
}
.org-stat-tile-icon { font-size: 15px; opacity: 0.85; }
.org-stat-tile-value { font-size: 26px; font-weight: 700; line-height: 1.15; margin-top: 4px; color: var(--org-viz-ink); }
.org-stat-tile-sub { font-size: 11px; color: var(--org-viz-muted); margin-top: 3px; }
.org-stat-blue { --stat-accent: #2a78d6; }
.org-stat-aqua { --stat-accent: #1baf7a; }
.org-stat-violet { --stat-accent: #4a3aa7; }
.org-stat-amber { --stat-accent: #eda100; }
.org-stat-warn { --stat-accent: #fab219; }
.org-stat-danger { --stat-accent: #d03b3b; }
.org-stat-good { --stat-accent: #0ca30c; }
.org-stat-neutral { --stat-accent: #c3c2b7; }

.org-kpi-modal { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.org-kpi-modal-count { margin: 0; font-size: 11px; }
.org-kpi-modal-list { min-height: 120px; max-height: min(58vh, 520px); overflow: auto; }
.org-kpi-modal-list .org-table-wrap { border: 1px solid var(--org-border); border-radius: 10px; }

.org-people-picker-list { display: flex; flex-direction: column; gap: 4px; }
.org-people-picker-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--org-border);
  border-radius: 10px;
  background: var(--org-surface-elevated);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.org-people-picker-row:hover {
  border-color: var(--org-accent, #3b82f6);
  background: var(--org-surface-hover, rgba(59, 130, 246, 0.06));
}
.org-people-picker-name { font-size: 13px; font-weight: 500; }
.org-people-picker-email { font-size: 11px; color: var(--org-text-muted); }
.org-people-picker-empty { margin: 8px 0; text-align: center; }

.org-detail-search { margin-bottom: 12px; }

/* ── Chart cards ── */
.org-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.org-chart-card2 {
  border: 1px solid var(--org-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.org-chart-card2-wide { grid-column: 1 / -1; }
.org-chart-card2-head h3 { margin: 0; font-size: 13.5px; }
.org-chart-card2-head p { margin: 3px 0 0; font-size: 11px; }
.org-chart-card2-foot { font-size: 11px; color: var(--org-viz-muted); }
.org-chart-card2-clickable {
  cursor: pointer;
  transition: border-color var(--org-transition-fast), box-shadow var(--org-transition-fast);
}
.org-chart-card2-clickable:hover,
.org-chart-card2-clickable:focus-visible {
  border-color: var(--org-border-strong);
  box-shadow: var(--org-shadow-md);
  outline: none;
}
.org-chart-card2-clickable .org-viz-clickable { cursor: pointer; }

.org-viz-empty {
  padding: 22px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--org-viz-muted);
}

/* ── Tooltip ── */
.org-viz-tip {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 11.5px;
  line-height: 1.45;
  box-shadow: var(--org-shadow-md);
  opacity: 0;
  transition: opacity 0.1s ease;
  max-width: 260px;
}
.org-viz-tip.visible { opacity: 1; }
.org-viz-tip-title { font-weight: 600; }

/* ── Legend ── */
.org-viz-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.org-viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--org-viz-ink-2);
  padding: 2px 0;
}
.org-viz-swatch {
  width: 9px; height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}
.org-viz-legend-value { font-weight: 600; color: var(--org-viz-ink); font-variant-numeric: tabular-nums; }
.org-viz-clickable { cursor: pointer; }
.org-viz-clickable:focus-visible { outline: 2px solid rgba(42, 120, 214, 0.45); outline-offset: 2px; }
.org-viz-legend-item.org-viz-clickable:hover { color: var(--org-viz-ink); }
.org-viz-hbar-row.org-viz-clickable:hover .org-viz-hbar-fill { filter: brightness(1.12); }
.org-viz-donut-seg.org-viz-clickable { cursor: pointer; }
.org-viz-donut-center.org-viz-clickable { cursor: pointer; border-radius: 50%; }

/* ── Donut ── */
.org-viz-donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.org-viz-donut-stage { position: relative; display: inline-flex; flex-shrink: 0; }
.org-viz-donut-seg { transition: opacity 0.12s; cursor: default; }
.org-viz-donut:hover .org-viz-donut-seg:not(:hover) { opacity: 0.55; }
.org-viz-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.org-viz-donut-center strong { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--org-viz-ink); }
.org-viz-donut-center span { font-size: 10px; color: var(--org-viz-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Horizontal bars ── */
.org-viz-hbar { display: flex; flex-direction: column; gap: 7px; }
.org-viz-hbar-row {
  display: grid;
  grid-template-columns: minmax(72px, 118px) 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 11.5px;
}
.org-viz-hbar-label {
  color: var(--org-viz-ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-viz-hbar-track {
  height: 14px;
  border-radius: 0 4px 4px 0;
  background: rgba(0, 0, 0, 0.035);
  overflow: hidden;
}
.org-viz-hbar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  transition: width 0.35s ease;
}
.org-viz-hbar-row:hover .org-viz-hbar-fill { filter: brightness(1.08); }
.org-viz-hbar-value {
  font-weight: 600;
  color: var(--org-viz-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── Stacked composition bar ── */
.org-viz-stacked-wrap { display: flex; flex-direction: column; gap: 10px; }
.org-viz-stacked {
  display: flex;
  gap: 2px; /* surface gap between segments */
  height: 16px;
  border-radius: 5px;
  overflow: hidden;
}
.org-viz-stacked-seg {
  min-width: 3px;
  transition: filter 0.12s;
  border-radius: 2px;
}
.org-viz-stacked-seg:hover { filter: brightness(1.1); }

/* ── Inline meter (table cells) ── */
.org-viz-meter { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.org-viz-meter-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.org-viz-meter-fill { height: 100%; border-radius: 999px; transition: width 0.3s; }
.org-viz-meter-value { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Section summary strip ── */
.org-summary-strip { margin-bottom: 2px; }
.org-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.org-toolbar-row-left { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex: 1; }
.org-toolbar-row-left .org-input { width: auto; min-width: 150px; }

.org-bulkbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--org-nav-active-border) 22%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--org-nav-active-border) 8%, white);
}

.org-bulkbar-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--org-viz-muted);
  margin-right: 4px;
}

.org-row-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.org-th-select,
.org-td-select {
  width: 36px;
  text-align: center;
  padding-left: 8px !important;
  padding-right: 4px !important;
}

.org-table-row-selected {
  background: color-mix(in srgb, var(--org-nav-active-border) 10%, transparent);
}

.org-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.org-role-user-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--org-border);
  border-radius: 8px;
  background: var(--org-surface);
}

.org-role-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.org-role-user-name {
  font-weight: 500;
}

.org-role-user-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--org-border);
}

.org-role-user-add .org-input {
  flex: 1;
}

.org-scope-target-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.org-scope-target-row .org-input {
  flex: 1;
  min-width: 180px;
}

.org-scope-create-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--org-border-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--org-nav-active-border) 5%, white);
}

/* ── Utility classes previously unstyled ── */
.org-muted { color: var(--org-viz-muted); }
.org-error { color: #b91c1c; font-size: 12px; }
.org-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #1c5cab;
  cursor: pointer;
  text-align: left;
}
.org-link:hover { text-decoration: underline; }
.org-row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.org-row-actions .btn { font-size: 11px; padding: 3px 8px; }
.org-inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--org-viz-ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.org-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.org-filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.org-person-cell { display: flex; align-items: center; gap: 10px; }
.org-person-cell .org-avatar { margin-left: 0; }
.org-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--org-border);
  border-radius: 12px;
  background: var(--org-surface);
  margin: 10px 0;
}
.org-detail-grid strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--org-viz-ink-2);
  margin-bottom: 3px;
}
.org-detail-grid p { margin: 0; font-size: 13px; font-weight: 600; }
.org-list { margin: 6px 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; }
.org-back { margin-bottom: 6px; }
.org-detail-panel {
  border: 1px solid var(--org-border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--org-surface);
}
.org-section-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* ═══ Flow chart (org hierarchy) ═════════════════════════════════════ */

.org-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.org-flow-viewport {
  position: relative;
  height: 520px;
  overflow: hidden;
  border: 1px solid var(--org-border);
  border-radius: 14px;
  background:
    radial-gradient(circle, rgba(11, 11, 11, 0.055) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(180deg, #fbfbfa, #f6f6f3);
  cursor: grab;
  outline: none;
}
.org-flow-viewport.panning { cursor: grabbing; }
.org-flow-viewport:focus-visible { box-shadow: 0 0 0 2px rgba(42, 120, 214, 0.35); }

.org-flow-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.org-flow-canvas.measuring { visibility: hidden; }

.org-flow-edges {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}
.org-flow-edge {
  fill: none;
  stroke: #c9c8c1;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.org-flow-edge-person { stroke-dasharray: none; stroke: #d5d4cd; }

.org-flow-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 8px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--org-border);
  box-shadow: var(--org-shadow-sm);
}
.org-flow-toolbar-sep { flex: 1; }
.org-flow-mode-group {
  display: inline-flex;
  border: 1px solid var(--org-border);
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
}
/* Scoped selector wins over the shared .org-flow-tool-btn width:26px so the
   labels get their natural width instead of overlapping in a 26px box. */
.org-flow-mode-group .org-flow-mode-btn {
  width: auto;
  min-width: max-content;
  padding: 0 11px;
  height: 26px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 0;
  white-space: nowrap;
  border-right: 1px solid var(--org-border);
}
.org-flow-mode-group .org-flow-mode-btn:last-child { border-right: none; }
.org-flow-mode-group .org-flow-mode-btn.active {
  background: rgba(42, 120, 214, 0.12);
  color: #1c5cab;
}
.org-flow-search {
  border: 1px solid var(--org-border);
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  min-width: 140px;
  max-width: 200px;
}
.org-flow-search:focus { outline: none; border-color: #2a78d6; box-shadow: 0 0 0 2px rgba(42, 120, 214, 0.15); }
.org-flow-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11.5px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.org-flow-crumb {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  color: #1c5cab;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.org-flow-crumb:hover { background: rgba(42, 120, 214, 0.08); }
.org-flow-crumb.current { color: var(--org-viz-ink); font-weight: 650; cursor: default; }
.org-flow-crumb-sep { color: var(--org-viz-muted); }
.org-flow-no-results {
  position: absolute;
  top: 24px;
  left: 24px;
  font-size: 12.5px;
  color: var(--org-viz-muted);
  white-space: nowrap;
}
.org-flownode-hit { border-color: #eda100; box-shadow: 0 0 0 2px rgba(237, 161, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.06); }
.org-flownode-focused { border-color: #2a78d6; box-shadow: 0 0 0 2px rgba(42, 120, 214, 0.3), 0 6px 18px rgba(0, 0, 0, 0.08); }
.org-flownode-open {
  margin-left: auto;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--org-border);
  background: #fff;
  font-size: 11px;
  cursor: pointer;
  color: var(--org-viz-ink-2);
  opacity: 0;
  transition: opacity 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.org-flownode:hover .org-flownode-open { opacity: 1; }
.org-flownode-open:hover { background: rgba(42, 120, 214, 0.1); color: #1c5cab; border-color: #2a78d6; }
.org-flow-tool-btn {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--org-viz-ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.org-flow-tool-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--org-viz-ink); }
.org-flow-tool-fit { width: auto; padding: 0 8px; font-size: 11px; }
.org-flow-zoom-label {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--org-viz-muted);
  min-width: 34px;
  text-align: center;
}

/* ── Flow node cards ── */
.org-flownode {
  position: absolute;
  width: 196px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid rgba(11, 11, 11, 0.1);
  border-radius: 12px;
  padding: 10px 12px 11px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s, border-color 0.15s;
  --node-color: #64748b;
}
.org-flownode::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--node-color);
}
.org-flownode:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 10px 26px rgba(0, 0, 0, 0.09);
  border-color: color-mix(in srgb, var(--node-color) 45%, rgba(11, 11, 11, 0.1));
  z-index: 3;
}
.org-flownode-clickable { cursor: pointer; }

.org-flownode-organization { --node-color: #6366f1; }
.org-flownode-department { --node-color: #0ea5e9; }
.org-flownode-team { --node-color: #14b8a6; }
.org-flownode-project { --node-color: #f59e0b; }
.org-flownode-subproject { --node-color: #a855f7; }
.org-flownode-person { --node-color: #94a3b8; width: 168px; padding: 8px 10px 9px; }

.org-flownode-compact { width: 168px; padding: 8px 10px 9px; }

.org-flownode-head { display: flex; align-items: flex-start; gap: 9px; }
.org-flownode-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: color-mix(in srgb, var(--node-color) 13%, white);
}
.org-flownode-person .org-flownode-icon,
.org-flownode-compact .org-flownode-icon { width: 24px; height: 24px; font-size: 12px; }
.org-flownode-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.org-flownode-name {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--org-viz-ink);
  word-break: break-word;
}
.org-flownode-type {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: color-mix(in srgb, var(--node-color) 72%, #333);
}
.org-flownode-meta { display: block; margin-top: 5px; font-size: 10.5px; color: var(--org-viz-muted); text-transform: capitalize; }

.org-flownode .org-chart-leads,
.org-flownode-leads { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(0, 0, 0, 0.06); }
.org-flownode .org-chart-leads { display: flex; flex-direction: column; gap: 3px; border-top-style: solid; }
.org-flownode .org-chart-lead { padding: 3px 7px; border-radius: 6px; font-size: 10.5px; display: flex; flex-direction: column; gap: 0; }

.org-flownode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.15s, max-height 0.15s;
}
.org-flownode:hover .org-flownode-actions { opacity: 1; max-height: 60px; }
.org-flownode-add-btn {
  border: 1px dashed color-mix(in srgb, var(--node-color) 45%, transparent);
  background: color-mix(in srgb, var(--node-color) 6%, white);
  color: color-mix(in srgb, var(--node-color) 80%, #222);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.org-flownode-add-btn:hover { background: color-mix(in srgb, var(--node-color) 14%, white); }

.org-flownode-toggle {
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(11, 11, 11, 0.12);
  background: #fff;
  color: var(--org-viz-ink-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--org-shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.org-flownode-toggle:hover {
  background: color-mix(in srgb, var(--node-color) 10%, white);
  border-color: color-mix(in srgb, var(--node-color) 50%, transparent);
  color: var(--org-viz-ink);
}

/* ── Vertical (indented) tree ── */
.org-vtree { font-size: 12.5px; }
.org-vtree-branch { position: relative; }
.org-vtree-children {
  margin-left: 15px;
  padding-left: 14px;
  border-left: 1.5px solid #dedcd4;
}
.org-vtree-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  position: relative;
  --node-color: #64748b;
}
.org-vtree-children > .org-vtree-branch > .org-vtree-row::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 11px;
  height: 1.5px;
  background: #dedcd4;
}
.org-vtree-row:hover { background: rgba(0, 0, 0, 0.035); }
.org-vtree-row-clickable { cursor: pointer; }
.org-vtree-row-organization { --node-color: #6366f1; }
.org-vtree-row-department { --node-color: #0ea5e9; }
.org-vtree-row-team { --node-color: #14b8a6; }
.org-vtree-row-project { --node-color: #f59e0b; }
.org-vtree-row-subproject { --node-color: #a855f7; }
.org-vtree-row-person { --node-color: #94a3b8; }
.org-vtree-toggle, .org-vtree-toggle-spacer {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.org-vtree-toggle {
  border: none;
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  color: var(--org-viz-muted);
  padding: 0;
}
.org-vtree-toggle:hover { background: rgba(0, 0, 0, 0.07); color: var(--org-viz-ink); }
.org-vtree-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: color-mix(in srgb, var(--node-color) 13%, white);
}
.org-vtree-name { font-weight: 600; color: var(--org-viz-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-vtree-type {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: color-mix(in srgb, var(--node-color) 72%, #333);
  flex-shrink: 0;
}
.org-vtree-leads {
  font-size: 10.5px;
  color: var(--org-viz-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.org-vtree-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--org-viz-ink-2);
}
.org-vtree-row .org-flownode-actions {
  margin-top: 0;
  margin-left: auto;
  max-height: none;
  overflow: visible;
}
.org-vtree-row:hover .org-flownode-actions { opacity: 1; }

.org-chart-mini-panel .org-vtree { max-height: 420px; overflow: auto; }

/* ═══ Pipeline stepper ═══════════════════════════════════════════════ */

.org-stepper-card {
  border: 1px solid var(--org-border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-sm);
}
.org-stepper-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.org-stepper-head strong { font-size: 14px; }
.org-stepper-desc { margin: 0 0 12px; font-size: 12px; color: var(--org-viz-muted); }
.org-stepper-track {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  padding: 6px 2px 10px;
}
.org-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 86px;
  max-width: 120px;
  flex-shrink: 0;
  text-align: center;
}
.org-step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--step-color, #2a78d6);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--step-color, #2a78d6) 14%, transparent);
}
.org-step-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--org-viz-ink-2);
  line-height: 1.3;
  word-break: break-word;
}
.org-step-connector {
  flex: 0 0 34px;
  height: 2px;
  margin-top: 14px;
  background: #d5d4cd;
  position: relative;
}
.org-step-connector::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3.2px;
  border-left: 6px solid #d5d4cd;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* Work status badges + activity work log */
.org-workstatus-not_started { background: rgba(152, 150, 143, 0.15); color: #52514e; }
.org-workstatus-in_progress { background: rgba(42, 120, 214, 0.14); color: #1c5cab; }
.org-workstatus-blocked { background: rgba(208, 59, 59, 0.14); color: #a32d2d; }
.org-workstatus-review { background: rgba(74, 58, 167, 0.13); color: #4a3aa7; }
.org-workstatus-done { background: rgba(12, 163, 12, 0.14); color: #067806; }

/* Activity feed (Organization → Activity) */
.org-activity-mount { min-height: 0; }
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: var(--org-space-md);
  min-height: 0;
}
.activity-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--org-space-lg);
  flex-wrap: wrap;
}
.activity-feed-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.activity-feed-blurb {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.62);
  max-width: 640px;
}
.activity-feed-actions {
  display: flex;
  align-items: center;
  gap: var(--org-space-sm);
  flex-wrap: wrap;
}
.activity-feed-actions .btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--org-border-strong);
  background: var(--org-surface-elevated);
  cursor: pointer;
  font: inherit;
}
.activity-feed-actions .btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.18);
}
.activity-view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--org-border);
}
.activity-view-switch .org-detail-tab {
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
}
.activity-view-switch .org-detail-tab.active {
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-sm);
  border-bottom: none;
}
.activity-feed-status {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.5);
  min-height: 16px;
}
.activity-feed-status.is-error { color: #b91c1c; font-weight: 500; }
.activity-feed-summary { min-height: 0; }
.activity-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.activity-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.16);
  color: #4338ca;
}
.activity-summary-chip strong { font-weight: 700; margin-left: 2px; }
.activity-summary-chip.critical {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.22);
  color: #b91c1c;
}
.activity-summary-chip.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #b45309;
}
.activity-summary-empty {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  font-style: italic;
}
.activity-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--org-border);
  background: var(--org-surface);
}
.activity-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.activity-filter-search {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--org-border-strong);
  font: inherit;
  font-size: 12px;
  background: var(--org-surface-elevated);
}
.activity-filter-search:focus {
  outline: none;
  border-color: var(--org-color-department);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}
.activity-filter-select,
.activity-filter-date {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--org-border-strong);
  font: inherit;
  font-size: 12px;
  background: var(--org-surface-elevated);
  min-width: 0;
}
.activity-filter-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}
.activity-feed-list { min-height: 120px; }
.activity-loading,
.activity-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  border: 1px dashed var(--org-border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
}
.activity-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(254, 242, 242, 0.85);
  color: #991b1b;
  font-size: 13px;
  line-height: 1.45;
}
.activity-error-title {
  font-weight: 600;
  font-size: 14px;
}
.activity-error-hint {
  font-size: 12px;
  color: rgba(153, 27, 27, 0.85);
  margin: 0;
}
.activity-error .btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: #991b1b;
}
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.activity-event-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--org-border);
  background: var(--org-surface-elevated);
  cursor: pointer;
  transition: border-color var(--org-transition-fast), box-shadow var(--org-transition-fast);
}
.activity-event-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: var(--org-shadow-sm);
}
.activity-event-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  font-size: 16px;
}
.activity-event-body { flex: 1; min-width: 0; }
.activity-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.activity-event-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.activity-event-summary {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.65);
}
.activity-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.5);
}
.app-activity-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}
.activity-severity {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: capitalize;
}
.activity-severity-info { background: rgba(148, 163, 184, 0.2); color: #475569; }
.activity-severity-success { background: rgba(16, 185, 129, 0.15); color: #047857; }
.activity-severity-warning { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.activity-severity-critical { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.activity-event-card.activity-severity-warning { border-left: 3px solid #f59e0b; }
.activity-event-card.activity-severity-critical { border-left: 3px solid #ef4444; }
.activity-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--org-z-modal);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.activity-detail-panel {
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--org-border);
  background: var(--org-surface-elevated);
  box-shadow: var(--org-shadow-lg);
  padding: 16px 18px;
}
.activity-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.activity-detail-head h3 { margin: 0; font-size: 16px; }
.activity-detail-close {
  border: none;
  background: rgba(0, 0, 0, 0.06);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.activity-detail-meta {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  font-size: 12px;
  margin: 12px 0 0;
}
.activity-detail-meta dt { margin: 0; opacity: 0.6; font-weight: 500; }
.activity-detail-meta dd { margin: 0; }
.activity-detail-metadata pre {
  font-size: 11px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  overflow: auto;
  max-height: 200px;
}
.recent-activity-list { display: flex; flex-direction: column; gap: 4px; }
.recent-activity-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.recent-activity-item:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--org-border);
}
.mgr-activity-feed { display: flex; flex-direction: column; gap: 6px; }
.mgr-activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--org-border);
  background: rgba(255, 255, 255, 0.45);
}
.mgr-activity-item[data-severity="warning"] { border-left: 3px solid #f59e0b; }
.mgr-activity-item[data-severity="critical"] { border-left: 3px solid #ef4444; }
.mgr-activity-icon { flex: 0 0 20px; font-size: 14px; }
.mgr-activity-title { font-weight: 600; font-size: 12px; }
.mgr-activity-summary { font-size: 11px; opacity: 0.75; margin-top: 2px; }
.mgr-activity-meta { font-size: 10px; opacity: 0.6; margin-top: 4px; }
.activity-worklog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.activity-worklog-table { font-size: 12px; }

/* Access chain (matrix) */
.org-access-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.org-access-chain-step {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(42, 120, 214, 0.06);
  border: 1px solid rgba(42, 120, 214, 0.18);
  max-width: 150px;
}
.org-access-chain-role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #1c5cab;
}
.org-access-chain-names {
  font-size: 11px;
  color: var(--org-viz-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-access-chain-arrow { color: var(--org-viz-muted); font-size: 12px; }

.org-pipeline-stage-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.org-pipeline-stage-chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  background: rgba(42, 120, 214, 0.09);
  color: #1c5cab;
  border: 1px solid rgba(42, 120, 214, 0.2);
  white-space: nowrap;
}


/* --- Completion sign-off chain --- */
.org-signoff-summary { margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.org-signoff-chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.org-signoff-step {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--org-border, #2a2f3a);
  border-radius: 10px;
  background: var(--org-panel-bg, rgba(255,255,255,0.02));
}
.org-signoff-step.current {
  border-color: var(--org-accent, #f5a623);
  box-shadow: 0 0 0 1px var(--org-accent, #f5a623) inset;
}
.org-signoff-step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-signoff-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  white-space: nowrap;
}
.org-signoff-badge[data-status="approved"] { background: rgba(46,160,67,0.22); color: #4ade80; }
.org-signoff-badge[data-status="ready_for_review"] { background: rgba(245,166,35,0.22); color: #fbbf24; }
.org-signoff-badge[data-status="rejected"],
.org-signoff-badge[data-status="needs_revision"] { background: rgba(220,38,38,0.22); color: #f87171; }
.org-signoff-step .org-detail-actions { margin-top: 10px; align-items: center; }
.org-signoff-step .org-input { max-width: 260px; }

/* --- Sign-off scope picker (whole project + subprojects) --- */
.org-signoff-scopes { margin: 4px 0 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.org-signoff-scope-label { width: 100%; font-size: 12px; opacity: 0.7; margin-bottom: 2px; }
.org-signoff-scope {
  padding: 6px 12px;
  border: 1px solid var(--org-border, #2a2f3a);
  border-radius: 999px;
  background: var(--org-panel-bg, rgba(255,255,255,0.02));
  cursor: pointer;
  font-size: 13px;
}
.org-signoff-scope.active {
  border-color: var(--org-accent, #f5a623);
  background: rgba(245,166,35,0.14);
}
.org-signoff-scope:hover { border-color: var(--org-accent, #f5a623); }

/* --- Project detail polish --- */
.org-project-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.org-project-detail .org-detail-header {
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--org-border, rgba(0,0,0,0.1));
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.82), rgba(247,249,252,0.72));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.org-detail-main {
  min-width: 0;
  flex: 1;
}
.org-detail-title-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.org-detail-title-row h2 {
  font-size: 22px;
  line-height: 1.1;
}
.org-detail-description {
  margin: 8px 0 0;
  max-width: 780px;
  color: rgba(15, 23, 42, 0.64);
  font-size: 13px;
  line-height: 1.45;
}
.org-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.org-detail-stats span,
.org-role-pill,
.org-tab-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.68);
  color: rgba(15, 23, 42, 0.72);
  font-size: 11px;
  line-height: 1;
}
.org-detail-stats span { padding: 7px 9px; }
.org-role-pill { padding: 5px 8px; font-weight: 650; }
.org-detail-stats strong {
  color: rgba(15, 23, 42, 0.92);
  font-variant-numeric: tabular-nums;
}
.org-detail-header-actions {
  justify-content: flex-end;
  align-content: flex-start;
  min-width: 240px;
}
.org-detail-tabs-wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--org-border, rgba(0,0,0,0.1));
  border-radius: 14px;
  background: rgba(255,255,255,0.58);
}
.org-detail-tab-group {
  min-width: 0;
}
.org-detail-tab-group-label {
  margin: 2px 4px 8px;
  color: rgba(15, 23, 42, 0.48);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.org-detail-tabs,
.org-workflow-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}
.org-detail-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(15, 23, 42, 0.66);
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}
.org-detail-tab:hover {
  border-color: rgba(14, 165, 233, 0.22);
  background: rgba(14, 165, 233, 0.06);
  color: rgba(15, 23, 42, 0.9);
}
.org-detail-tab.active {
  border-color: rgba(14, 165, 233, 0.34);
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.72);
}
.org-tab-count {
  min-width: 18px;
  justify-content: center;
  padding: 3px 5px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 10px;
  font-weight: 700;
}
.org-empty-state {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  background: rgba(255,255,255,0.54);
}
.org-empty-state strong {
  font-size: 14px;
}
.org-empty-state p {
  margin: 0;
  max-width: 720px;
  line-height: 1.45;
}
.org-empty-kicker {
  width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .org-detail-tabs-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .org-project-detail .org-detail-header { flex-direction: column; }
  .org-detail-header-actions { justify-content: flex-start; min-width: 0; }
  .org-detail-tabs-wrap { grid-template-columns: 1fr; }
}

/* ── Changes Log ── */
.org-changelog { display: flex; flex-direction: column; gap: 12px; }
.org-changelog-status { font-size: 12px; color: var(--org-muted, #64748b); }
.org-changelog-filters { display: flex; flex-direction: column; gap: 10px; }
.org-changelog-filter-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.org-changelog-filter-row .org-search-wrap { flex: 1; min-width: 220px; }
.org-changelog-scope-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--org-ink-2, #475569); cursor: pointer;
}
.org-changelog-stat-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.org-changelog-stat-chip {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  background: rgba(42, 120, 214, 0.08); color: var(--org-ink-2, #475569);
}
.org-changelog-stat-chip strong { color: var(--org-ink, #0f172a); }
.org-changelog-table-wrap {
  border: 1px solid var(--org-border, rgba(0,0,0,0.08));
  border-radius: 10px; max-height: min(62vh, 640px);
}
.org-changelog-table th { white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--org-muted, #64748b); }
.org-changelog-row { cursor: pointer; transition: background 0.12s ease; }
.org-changelog-event-row:hover { background: rgba(42, 120, 214, 0.05); }
.org-changelog-group-row {
  background: rgba(0, 0, 0, 0.025); font-weight: 600;
}
.org-changelog-group-row:hover { background: rgba(0, 0, 0, 0.04); }
.org-changelog-group-label { color: var(--org-ink, #0f172a); }
.org-changelog-actor { font-weight: 600; }
.org-changelog-title { font-weight: 500; }
.org-changelog-type-chip { white-space: nowrap; }
.org-changelog-event-type {
  font-size: 11px; color: var(--org-muted, #64748b);
  text-transform: capitalize;
}
.org-changelog-col-when { width: 140px; white-space: nowrap; font-size: 11.5px; color: var(--org-muted); }
.org-changelog-col-who { min-width: 120px; }
.org-changelog-col-type { width: 110px; }
.org-changelog-col-scope { min-width: 100px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-changelog-empty { padding: 32px 16px; text-align: center; color: var(--org-muted); font-size: 13px; }

/* ── Organization AI assistant (floating circle + chat) ─────────────────── */
.org-ai-fab {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #fff;
  background: var(--org-accent, #3b82f6);
  box-shadow: var(--org-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.25));
  z-index: 40;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.org-ai-fab:hover { transform: translateY(-2px) scale(1.04); }

.org-ai-panel {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 380px;
  max-width: calc(100% - 40px);
  height: 480px;
  max-height: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  background: var(--org-surface-elevated, #fff);
  border: 1px solid var(--org-border, rgba(0, 0, 0, 0.12));
  border-radius: 14px;
  box-shadow: var(--org-shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.28));
  z-index: 41;
  overflow: hidden;
}
.org-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--org-border, rgba(0, 0, 0, 0.1));
}
.org-ai-title { font-weight: 600; font-size: 13.5px; }
.org-ai-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: var(--org-muted, #666);
  padding: 2px 6px;
}
.org-ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.org-ai-msg {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.org-ai-msg.user {
  align-self: flex-end;
  background: var(--org-accent, #3b82f6);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.org-ai-msg.assistant {
  align-self: flex-start;
  background: var(--org-surface, rgba(0, 0, 0, 0.05));
  border-bottom-left-radius: 4px;
}
.org-ai-composer {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--org-border, rgba(0, 0, 0, 0.1));
}
.org-ai-input {
  flex: 1;
  resize: none;
  max-height: 96px;
  padding: 8px 10px;
  border: 1px solid var(--org-border, rgba(0, 0, 0, 0.15));
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
}
.org-ai-send {
  border: none;
  border-radius: 9px;
  padding: 0 14px;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
  background: var(--org-accent, #3b82f6);
}
.org-ai-send:disabled { opacity: 0.5; cursor: default; }

.org-ai-inline-link,
.org-ai-result-q { display: inline-block; }
.org-ai-inline-link {
  border: none;
  background: transparent;
  color: var(--org-accent, #3b82f6);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}
.org-ai-result-q { color: var(--org-muted, #666); font-style: italic; margin: 0 0 4px; }
.org-ai-result-count { font-size: 12px; color: var(--org-muted, #666); margin: 0 0 10px; }

.org-ai-approve-lead { font-size: 13px; color: var(--org-muted, #555); margin: 0 0 10px; }
.org-ai-approve-summary {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--org-surface, rgba(0, 0, 0, 0.05));
  border: 1px solid var(--org-border, rgba(0, 0, 0, 0.1));
  font-size: 14px;
  font-weight: 500;
}
.org-ai-err { color: var(--org-status-danger, #c0392b); font-size: 12.5px; margin: 10px 0 0; }
.org-ai-result-note {
  font-size: 13.5px;
  margin: 0 0 8px;
  padding: 8px 11px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--org-accent, #3b82f6) 12%, transparent);
  color: inherit;
}
.org-ai-result-answer {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  margin: 0 0 10px;
  padding: 10px 13px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--org-accent, #3b82f6) 14%, transparent);
  white-space: pre-wrap;
}
